~ubuntu-branches/ubuntu/raring/apgdiff/raring

« back to all changes in this revision

Viewing changes to src/test/resources/cz/startnet/utils/pgdiff/loader/schema_1.sql

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Berg
  • Date: 2008-09-09 15:42:54 UTC
  • Revision ID: james.westby@ubuntu.com-20080909154254-458sv7ew1rczdal1
Tags: upstream-1.2
ImportĀ upstreamĀ versionĀ 1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
CREATE TABLE fax_boxes (
 
2
  fax_box_id serial NOT NULL,
 
3
  name text,
 
4
  CONSTRAINT fax_boxes_pkey PRIMARY KEY (fax_box_id)
 
5
);
 
6
CREATE TABLE extensions (id serial NOT NULL);
 
7
ALTER TABLE fax_boxes OWNER TO postgres;
 
8
ALTER TABLE extensions ADD FOREIGN KEY (fax_box_id) REFERENCES fax_boxes
 
9
(fax_box_id)    ON UPDATE RESTRICT ON DELETE RESTRICT;
 
10
 
 
11
CREATE TABLE faxes (
 
12
  fax_id serial NOT NULL,
 
13
  fax_box_id int4,
 
14
  from_name text,
 
15
  from_number text,
 
16
  status int4, -- 1=pending, 2=failed, 3=received
 
17
  pages int4,
 
18
  time_received timestamp DEFAULT now(),
 
19
  time_finished_received timestamp,
 
20
  "read" int2 DEFAULT 0,
 
21
  station_id text,
 
22
  CONSTRAINT faxes_pkey PRIMARY KEY (fax_id),
 
23
  CONSTRAINT faxes_fax_box_id_fkey FOREIGN KEY (fax_box_id)
 
24
      REFERENCES fax_boxes (fax_box_id) MATCH SIMPLE
 
25
      ON UPDATE RESTRICT ON DELETE CASCADE
 
26
);