feature #4: create procedure for citizen
This commit is contained in:
@@ -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
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user