Line # Revision Author
1 198 ahitrov CREATE TABLE orders (
2 id integer DEFAULT nextval(('public.documents_id_seq'::text)::regclass) NOT NULL,
3 ctime timestamp without time zone DEFAULT now() NOT NULL,
4 mtime timestamp without time zone DEFAULT now() NOT NULL,
5 dtime timestamp without time zone DEFAULT now() NOT NULL,
6 class text DEFAULT 'webshop::Order'::text NOT NULL,
7 status smallint default 0 NOT NULL,
8 413 ahitrov payment smallint default 0,
9 441 ahitrov syncro smallint default 0,
10 449 ahitrov synctime timestamp without time zone,
11 198 ahitrov sections integer[],
12 uid integer,
13 434 ahitrov company_id integer,
14 769 ahitrov google_id bigint,
15 yandex_id bigint,
16 198 ahitrov manager_id integer,
17 vault_id integer,
18 postman_id integer,
19 session text,
20 name text,
21 data text
22 );
23
24 CREATE INDEX orders_sections ON orders USING gist (sections);
25 CREATE INDEX orders_session ON orders USING btree (session) where session is not null;
26 CREATE INDEX orders_uid ON orders USING btree (uid) where uid is not null;