db/schema/020_user.sql

19 lines
844 B
MySQL
Raw Normal View History

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
, 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
);
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[]
);