feature #4: create procedure for citizen

This commit is contained in:
2019-07-26 14:29:48 +02:00
parent 0a92316128
commit fc06965cda
8 changed files with 110 additions and 11 deletions

View File

@@ -11,19 +11,13 @@ create table "user"
password text not null check ( password != '' )
);
create type "name" as (
first_name text,
last_name text,
civility text
);
create table citizen
(
id uuid default uuid_generate_v4() not null primary key,
created_at timestamptz default now() not null,
name "name" not null check ( name != '' ),
name jsonb not null check ( name ? 'first_name' and name ? 'last_name' ),
birthday date not null,
user_id uuid not null references "user" (id),
user_id uuid not null references "user" (id) unique,
vote_annonymous boolean default true not null,
follow_annonymous boolean default true not null
);