forked from rodrigobranas/mba_fullcycle_design_patterns
-
Notifications
You must be signed in to change notification settings - Fork 119
Expand file tree
/
Copy pathcreate.sql
More file actions
21 lines (17 loc) · 709 Bytes
/
create.sql
File metadata and controls
21 lines (17 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
drop schema branas cascade;
create schema branas;
create table branas.contract (
id_contract uuid not null default uuid_generate_v4() primary key,
description text,
amount numeric,
periods integer,
date timestamp
);
create table branas.payment (
id_payment uuid not null default uuid_generate_v4() primary key,
id_contract uuid references branas.contract (id_contract),
amount numeric,
date timestamp
);
insert into branas.contract values ('4224a279-c162-4283-86f5-1095f559b08c', 'Prestação de serviços escolares', 6000, 12, '2022-01-01T10:00:00');
insert into branas.payment values ('c931d9db-c8d8-44d4-8861-b3d6b734c64e', '4224a279-c162-4283-86f5-1095f559b08c', 6000, '2022-01-05T10:00:00');