db/db-schema.sql
changeset 61 b65843860274
parent 56 9409e7ab3f9d
child 65 a35a0edf9ddd
equal deleted inserted replaced
60:e2a2e2045c0e 61:b65843860274
     2 create table "code_list_item" (
     2 create table "code_list_item" (
     3     "l3" bigint not null,
     3     "l3" bigint not null,
     4     "l1" bigint not null,
     4     "l1" bigint not null,
     5     "i18n" boolean not null,
     5     "i18n" boolean not null,
     6     "name" varchar(100) not null,
     6     "name" varchar(100) not null,
       
     7     "updated_at" timestamp not null,
     7     "ol2" bigint,
     8     "ol2" bigint,
     8     "s3" varchar(200) not null,
     9     "s3" varchar(200) not null,
     9     "id" bigint primary key not null,
    10     "id" bigint primary key not null,
    10     "oi1" integer,
    11     "oi1" integer,
    11     "rank" integer not null,
    12     "rank" integer not null,
    18     "oi2" integer,
    19     "oi2" integer,
    19     "i1" integer not null,
    20     "i1" integer not null,
    20     "s1" varchar(200) not null,
    21     "s1" varchar(200) not null,
    21     "note" varchar(10240),
    22     "note" varchar(10240),
    22     "os2" varchar(200),
    23     "os2" varchar(200),
       
    24     "created_at" timestamp not null,
       
    25     "created_by" bigint,
    23     "i2" integer not null,
    26     "i2" integer not null,
    24     "oi3" integer,
    27     "oi3" integer,
    25     "l2" bigint not null,
    28     "l2" bigint not null,
    26     "ol3" bigint,
    29     "ol3" bigint,
       
    30     "updated_by" bigint,
    27     "os3" varchar(200),
    31     "os3" varchar(200),
    28     "deleted" boolean not null
    32     "deleted" boolean not null
    29   );
    33   );
    30 create sequence "code_list_item_id_seq";
    34 create sequence "code_list_item_id_seq";
    31 -- indexes on code_list_item
    35 -- indexes on code_list_item
    32 create index "code_list_item_code_list_idx" on "code_list_item" ("code_list");
    36 create index "code_list_item_code_list_idx" on "code_list_item" ("code_list");
    33 create table "user" (
    37 create table "user" (
    34     "name" varchar(100) not null,
    38     "name" varchar(100) not null,
       
    39     "updated_at" timestamp not null,
    35     "id" bigint primary key not null,
    40     "id" bigint primary key not null,
    36     "note" varchar(10240),
    41     "note" varchar(10240),
       
    42     "created_at" timestamp not null,
       
    43     "created_by" bigint,
    37     "login" varchar(40) not null,
    44     "login" varchar(40) not null,
       
    45     "updated_by" bigint,
    38     "deleted" boolean not null,
    46     "deleted" boolean not null,
    39     "active" boolean not null,
    47     "active" boolean not null,
    40     "password" varchar(128) not null
    48     "password" varchar(128) not null
    41   );
    49   );
    42 create sequence "user_id_seq";
    50 create sequence "user_id_seq";
    43 -- indexes on user
    51 -- indexes on user
    44 create index "user_login_idx" on "user" ("login");
    52 create index "user_login_idx" on "user" ("login");
    45 create table "city" (
    53 create table "city" (
    46     "name" varchar(100) not null,
    54     "name" varchar(100) not null,
       
    55     "updated_at" timestamp not null,
    47     "id" bigint primary key not null,
    56     "id" bigint primary key not null,
    48     "country_id" bigint not null,
    57     "country_id" bigint not null,
    49     "note" varchar(10240)
    58     "note" varchar(10240),
       
    59     "created_at" timestamp not null,
       
    60     "created_by" bigint,
       
    61     "updated_by" bigint
    50   );
    62   );
    51 create sequence "s_city_id";
    63 create sequence "s_city_id";
    52 create table "address" (
    64 create table "address" (
    53     "id" bigint primary key not null,
    65     "id" bigint primary key not null,
    54     "city_id" bigint not null,
    66     "city_id" bigint not null,
    58   );
    70   );
    59 create sequence "s_address_id";
    71 create sequence "s_address_id";
    60 create table "country" (
    72 create table "country" (
    61     "iso3" varchar(3) not null,
    73     "iso3" varchar(3) not null,
    62     "name" varchar(100) not null,
    74     "name" varchar(100) not null,
       
    75     "updated_at" timestamp not null,
    63     "id" bigint primary key not null,
    76     "id" bigint primary key not null,
    64     "iso2" varchar(2) not null,
    77     "iso2" varchar(2) not null,
    65     "note" varchar(10240)
    78     "note" varchar(10240),
       
    79     "created_at" timestamp not null,
       
    80     "created_by" bigint,
       
    81     "updated_by" bigint
    66   );
    82   );
    67 create sequence "s_country_id";
    83 create sequence "s_country_id";
    68 create table "contact" (
    84 create table "contact" (
    69     "name" varchar(100) not null,
    85     "name" varchar(100) not null,
       
    86     "updated_at" timestamp not null,
    70     "id" bigint primary key not null,
    87     "id" bigint primary key not null,
    71     "work_mobile" varchar(40) not null,
    88     "work_mobile" varchar(40) not null,
    72     "private_mail" varchar(256),
    89     "private_mail" varchar(256),
    73     "last_name" varchar(80) not null,
    90     "last_name" varchar(80) not null,
    74     "work_mail" varchar(256) not null,
    91     "work_mail" varchar(256) not null,
    75     "first_name" varchar(80) not null,
    92     "first_name" varchar(80) not null,
    76     "fax" varchar(40),
    93     "fax" varchar(40),
    77     "note" varchar(10240),
    94     "note" varchar(10240),
       
    95     "created_at" timestamp not null,
       
    96     "created_by" bigint,
    78     "other_mail" varchar(256),
    97     "other_mail" varchar(256),
    79     "position" varchar(40),
    98     "position" varchar(40),
    80     "other_mobile" varchar(40),
    99     "other_mobile" varchar(40),
       
   100     "updated_by" bigint,
    81     "private_mobile" varchar(40),
   101     "private_mobile" varchar(40),
    82     "private_phone" varchar(40),
   102     "private_phone" varchar(40),
    83     "work_phone" varchar(40)
   103     "work_phone" varchar(40)
    84   );
   104   );
    85 create sequence "contact_id_seq";
   105 create sequence "contact_id_seq";
    86 create table "company" (
   106 create table "company" (
    87     "name" varchar(100) not null,
   107     "name" varchar(100) not null,
       
   108     "updated_at" timestamp not null,
    88     "id" bigint primary key not null,
   109     "id" bigint primary key not null,
    89     "partner" integer not null,
   110     "partner" integer not null,
    90     "ico" varchar(40) not null,
   111     "ico" varchar(40) not null,
    91     "note" varchar(10240),
   112     "note" varchar(10240),
       
   113     "created_at" timestamp not null,
       
   114     "created_by" bigint,
    92     "corresp_address_id" bigint,
   115     "corresp_address_id" bigint,
       
   116     "updated_by" bigint,
    93     "pin" integer not null,
   117     "pin" integer not null,
    94     "address_id" bigint not null
   118     "address_id" bigint not null
    95   );
   119   );
    96 create sequence "s_company_id";
   120 create sequence "s_company_id";
    97 create table "bank_account" (
   121 create table "bank_account" (