server/test/unittest_schema2sql.py
changeset 10443 2d3834df64ab
parent 10204 f8ccae1e271d
child 10444 fb7c1013189e
equal deleted inserted replaced
10442:b2d2099dfae8 10443:2d3834df64ab
    94  tel integer,
    94  tel integer,
    95  fax integer,
    95  fax integer,
    96  datenaiss date,
    96  datenaiss date,
    97  test boolean,
    97  test boolean,
    98  salary float
    98  salary float
       
    99 , CONSTRAINT cstr41fe7db9ce1d5be95de2477e26590386 CHECK(promo IN ('bon', 'pasbon'))
    99 );
   100 );
   100 CREATE UNIQUE INDEX unique_e6c2d219772dbf1715597f7d9a6b3892 ON Person(nom,prenom);
   101 CREATE UNIQUE INDEX unique_e6c2d219772dbf1715597f7d9a6b3892 ON Person(nom,prenom);
   101 
   102 
   102 CREATE TABLE Salaried(
   103 CREATE TABLE Salaried(
   103  nom varchar(64) NOT NULL,
   104  nom varchar(64) NOT NULL,
   111  tel integer,
   112  tel integer,
   112  fax integer,
   113  fax integer,
   113  datenaiss date,
   114  datenaiss date,
   114  test boolean,
   115  test boolean,
   115  salary float
   116  salary float
       
   117 , CONSTRAINT cstrc8556fcc665865217761cdbcd220cae0 CHECK(promo IN ('bon', 'pasbon'))
   116 );
   118 );
   117 CREATE UNIQUE INDEX unique_98da0f9de8588baa8966f0b1a6f850a3 ON Salaried(nom,prenom);
   119 CREATE UNIQUE INDEX unique_98da0f9de8588baa8966f0b1a6f850a3 ON Salaried(nom,prenom);
   118 
   120 
   119 CREATE TABLE Societe(
   121 CREATE TABLE Societe(
   120  nom varchar(64),
   122  nom varchar(64),
   125  ad1 varchar(128),
   127  ad1 varchar(128),
   126  ad2 varchar(128),
   128  ad2 varchar(128),
   127  ad3 varchar(128),
   129  ad3 varchar(128),
   128  cp varchar(12),
   130  cp varchar(12),
   129  ville varchar(32)
   131  ville varchar(32)
       
   132 , CONSTRAINT cstrc51dd462e9f6115506a0fe468d4c8114 CHECK(fax <= tel)
   130 );
   133 );
   131 
   134 
   132 CREATE TABLE State(
   135 CREATE TABLE State(
   133  eid integer PRIMARY KEY REFERENCES entities (eid),
   136  eid integer PRIMARY KEY REFERENCES entities (eid),
   134  name varchar(256) NOT NULL,
   137  name varchar(256) NOT NULL,
   153  long_desc text NOT NULL,
   156  long_desc text NOT NULL,
   154  author varchar(100) NOT NULL,
   157  author varchar(100) NOT NULL,
   155  author_email varchar(100) NOT NULL,
   158  author_email varchar(100) NOT NULL,
   156  mailinglist varchar(100),
   159  mailinglist varchar(100),
   157  debian_handler varchar(6)
   160  debian_handler varchar(6)
       
   161 , CONSTRAINT cstr70f766f834557c715815d76f0a0db956 CHECK(license IN ('GPL', 'ZPL'))
       
   162 , CONSTRAINT cstr831a117424d0007ae0278cc15f344f5e CHECK(debian_handler IN ('machin', 'bidule'))
   158 );
   163 );
   159 
   164 
   160 
   165 
   161 CREATE TABLE concerne_relation (
   166 CREATE TABLE concerne_relation (
   162   eid_from INTEGER NOT NULL REFERENCES entities (eid),
   167   eid_from INTEGER NOT NULL REFERENCES entities (eid),