1 |
701 |
ahitrov |
create sequence money_receipts_id_seq; |
2 |
|
|
select setval('money_receipts_id_seq', 1, true); |
3 |
693 |
ahitrov |
|
4 |
701 |
ahitrov |
create table money_receipts |
5 |
693 |
ahitrov |
( |
6 |
701 |
ahitrov |
id integer not null primary key default nextval('public.money_receipts_id_seq'::text), |
7 |
693 |
ahitrov |
class text not null, |
8 |
|
|
ctime timestamp not null default now(), |
9 |
|
|
mtime timestamp not null default now(), |
10 |
|
|
dtime timestamp not null default now(), |
11 |
|
|
status smallint not null default 0, |
12 |
|
|
provider text, |
13 |
|
|
session_id text, |
14 |
|
|
name text, |
15 |
|
|
order_id integer not null, |
16 |
|
|
currency_code varchar(4), |
17 |
|
|
sum float, |
18 |
|
|
success smallint default 0, |
19 |
|
|
data text |
20 |
|
|
); |
21 |
701 |
ahitrov |
CREATE INDEX money_receipts_sessions ON money_receipts USING btree (provider, session_id) WHERE session_id is not null; |
22 |
|
|
CREATE INDEX money_receipts_orders ON money_receipts USING btree (order_id); |