feat: Init backend
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
databaseChangeLog:
|
||||
- include:
|
||||
file: db/migrations/001-schema.sql
|
||||
@@ -0,0 +1,34 @@
|
||||
create table application_form
|
||||
(
|
||||
created_at timestamp(6) not null,
|
||||
modified_at timestamp(6) not null,
|
||||
id uuid not null,
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table form_element_options
|
||||
(
|
||||
employee_data_category tinyint not null check (employee_data_category between 0 and 3),
|
||||
processing_purpose tinyint not null check (processing_purpose between 0 and 3),
|
||||
form_element_id uuid not null,
|
||||
label varchar(255) not null,
|
||||
option_value varchar(255) not null
|
||||
);
|
||||
|
||||
create table form_element
|
||||
(
|
||||
type tinyint not null check (type between 0 and 4),
|
||||
application_form_id uuid not null,
|
||||
id uuid not null,
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
alter table if exists form_element_options
|
||||
add constraint FKnq0lpby5nspv1xi27n9el6us6
|
||||
foreign key (form_element_id)
|
||||
references form_element;
|
||||
|
||||
alter table if exists form_element
|
||||
add constraint FKdniyq3l10lncw48tft15js5gb
|
||||
foreign key (application_form_id)
|
||||
references application_form;
|
||||
Reference in New Issue
Block a user