Line # Revision Author
1 853 ahitrov CREATE TABLE webshop_user_coupons (
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 class text DEFAULT 'webshop::ProfileCouponLink'::text NOT NULL,
6 status smallint default 0 NOT NULL,
7 session text,
8 source_id integer,
9 source_class text,
10 dest_id integer,
11 dest_class text default 'webshop::Coupon'::text,
12 data text
13 );
14
15 CREATE INDEX webshop_user_coupons_session ON webshop_user_coupons USING btree (session) where session IS NOT NULL;
16 CREATE UNIQUE INDEX webshop_user_coupons_in_order ON webshop_user_coupons USING btree (source_id, dest_id) where source_id > 0;
17 create index webshop_user_coupons_source on webshop_user_coupons (source_id);
18 create index webshop_user_coupons_dest on webshop_user_coupons (dest_id);