-
Notifications
You must be signed in to change notification settings - Fork 10
/
db.sql
37 lines (29 loc) · 1010 Bytes
/
db.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
-- =============================================================================
-- Diagram Name: 47rest
-- Created on: 4/17/2018 4:45:14 PM
-- Diagram Version:
-- =============================================================================
CREATE TABLE "obj_user" (
"id_user" SERIAL NOT NULL,
"user_email" varchar NOT NULL,
"user_name" varchar NOT NULL,
"user_password" varchar NOT NULL,
CONSTRAINT "obj_user_pkey" PRIMARY KEY("id_user")
)
WITH (
OIDS = False
);
CREATE UNIQUE INDEX "idx_user_email" ON "obj_user" (
"user_email"
);
COMMENT ON TABLE "obj_user" IS 'Пользователи';
CREATE TABLE "aggr_bills" (
"id_bills" BIGSERIAL NOT NULL,
"bills_count" int8 NOT NULL,
"bills_amount" float8 NOT NULL,
"bills_paid_count" int8 NOT NULL,
"bills_paid_amount" float8 NOT NULL,
"bills_add_timestamp" timestamp with time zone NOT NULL,
PRIMARY KEY("id_bills"),
CONSTRAINT "constr_bills_add_timestamp_unique" UNIQUE("bills_add_timestamp")
);