feat: Add table logic for role and permission sections
This commit is contained in:
@@ -53,33 +53,43 @@ create table comment
|
||||
|
||||
create table form_element_options
|
||||
(
|
||||
employee_data_category smallint not null check (employee_data_category between 0 and 3),
|
||||
processing_purpose smallint not null check (processing_purpose between 0 and 3),
|
||||
form_element_id uuid not null,
|
||||
label varchar(255) not null,
|
||||
option_value TEXT not null
|
||||
col_config_filter_src_col_idx integer,
|
||||
col_config_is_checkbox boolean,
|
||||
col_config_is_read_only boolean,
|
||||
col_config_source_col_idx integer,
|
||||
employee_data_category smallint not null check (employee_data_category between 0 and 3),
|
||||
is_multiple_allowed boolean,
|
||||
processing_purpose smallint not null check (processing_purpose between 0 and 3),
|
||||
row_constraint_current_row_key_column_index integer,
|
||||
row_constraint_key_column_index integer,
|
||||
row_constraint_value_column_index integer,
|
||||
form_element_id uuid not null,
|
||||
col_config_filter_expected_val varchar(255),
|
||||
col_config_filter_operator varchar(255) check (col_config_filter_operator in
|
||||
('EQUALS', 'NOT_EQUALS', 'IS_EMPTY',
|
||||
'IS_NOT_EMPTY')),
|
||||
col_config_source_table_ref varchar(255),
|
||||
label varchar(255) not null,
|
||||
option_value TEXT not null,
|
||||
row_constraint_table_reference varchar(255)
|
||||
);
|
||||
|
||||
create table form_element
|
||||
(
|
||||
form_element_order integer,
|
||||
is_clonable boolean not null,
|
||||
type smallint not null check (type between 0 and 7),
|
||||
form_element_sub_section_id uuid not null,
|
||||
id uuid not null,
|
||||
description varchar(255),
|
||||
form_element_condition_type varchar(255) check (form_element_condition_type in ('SHOW', 'HIDE')),
|
||||
form_element_expected_value varchar(255),
|
||||
form_element_operator varchar(255) check (form_element_operator in
|
||||
('EQUALS', 'NOT_EQUALS', 'IS_EMPTY', 'IS_NOT_EMPTY')),
|
||||
reference varchar(255),
|
||||
section_spawn_condition_type varchar(255) check (section_spawn_condition_type in ('SHOW', 'HIDE')),
|
||||
section_spawn_expected_value varchar(255),
|
||||
section_spawn_operator varchar(255) check (section_spawn_operator in
|
||||
('EQUALS', 'NOT_EQUALS', 'IS_EMPTY', 'IS_NOT_EMPTY')),
|
||||
source_form_element_reference varchar(255),
|
||||
template_reference varchar(255),
|
||||
title varchar(255),
|
||||
can_add_rows boolean,
|
||||
form_element_order integer,
|
||||
is_clonable boolean not null,
|
||||
row_preset_filter_src_col_idx integer,
|
||||
type smallint not null check (type between 0 and 8),
|
||||
form_element_sub_section_id uuid not null,
|
||||
id uuid not null,
|
||||
description varchar(255),
|
||||
reference varchar(255),
|
||||
row_preset_filter_expected_val varchar(255),
|
||||
row_preset_filter_operator varchar(255) check (row_preset_filter_operator in
|
||||
('EQUALS', 'NOT_EQUALS', 'IS_EMPTY', 'IS_NOT_EMPTY')),
|
||||
row_preset_source_table_ref varchar(255),
|
||||
title varchar(255),
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
@@ -122,6 +132,33 @@ create table notification
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table section_spawn_triggers
|
||||
(
|
||||
form_element_id uuid not null,
|
||||
section_spawn_condition_type varchar(255) check (section_spawn_condition_type in ('SHOW', 'HIDE')),
|
||||
section_spawn_expected_value varchar(255),
|
||||
section_spawn_operator varchar(255) check (section_spawn_operator in
|
||||
('EQUALS', 'NOT_EQUALS', 'IS_EMPTY', 'IS_NOT_EMPTY')),
|
||||
template_reference varchar(255)
|
||||
);
|
||||
|
||||
create table table_column_mappings
|
||||
(
|
||||
source_column_index integer,
|
||||
target_column_index integer,
|
||||
form_element_id uuid not null
|
||||
);
|
||||
|
||||
create table visibility_conditions
|
||||
(
|
||||
form_element_id uuid not null,
|
||||
form_element_condition_type varchar(255) check (form_element_condition_type in ('SHOW', 'HIDE')),
|
||||
form_element_expected_value varchar(255),
|
||||
form_element_operator varchar(255) check (form_element_operator in
|
||||
('EQUALS', 'NOT_EQUALS', 'IS_EMPTY', 'IS_NOT_EMPTY')),
|
||||
source_form_element_reference varchar(255)
|
||||
);
|
||||
|
||||
alter table if exists application_form
|
||||
add constraint FKhtad5onoy2jknhtyfmx6cvvey
|
||||
foreign key (created_by_id)
|
||||
@@ -182,3 +219,18 @@ alter table if exists notification
|
||||
add constraint FKeg1j4hnp0y4lbm0y35hgr4e8r
|
||||
foreign key (recipient_id)
|
||||
references app_user;
|
||||
|
||||
alter table if exists section_spawn_triggers
|
||||
add constraint FK7lf0hf8cepm2o9nty147x2ahm
|
||||
foreign key (form_element_id)
|
||||
references form_element;
|
||||
|
||||
alter table if exists table_column_mappings
|
||||
add constraint FK2t3a4fl5kqtqky39r7boqegf9
|
||||
foreign key (form_element_id)
|
||||
references form_element;
|
||||
|
||||
alter table if exists visibility_conditions
|
||||
add constraint FK5xuf7bd179ogpq5a1m3g8q7jb
|
||||
foreign key (form_element_id)
|
||||
references form_element;
|
||||
|
||||
Reference in New Issue
Block a user