2023-06-10 17:04:03 +00:00
|
|
|
select create_newtype_text('public.usr_username');
|
2023-06-10 04:51:28 +00:00
|
|
|
|
|
|
|
create table public.usr
|
|
|
|
( id int not null primary key generated always as identity
|
|
|
|
, uid uuid not null default gen_random_uuid()
|
|
|
|
, deleted boolean not null default false
|
2023-06-10 17:26:53 +00:00
|
|
|
, username public.usr_username not null
|
2023-06-10 04:51:28 +00:00
|
|
|
, password public.hashed_text not null
|
|
|
|
, email public.email not null unique
|
|
|
|
);
|
|
|
|
|
2023-06-10 17:26:53 +00:00
|
|
|
select setup_audit_and_soft_delete( 'public'
|
|
|
|
, 'usr'
|
|
|
|
, array[ row('username', 'public.usr_username')
|
|
|
|
, row('password', 'public.hashed_text')
|
|
|
|
, row('email', 'public.email')
|
|
|
|
] :: audited_column[]
|
|
|
|
);
|