-
-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#56 refactor+add org level configuration table
- Loading branch information
Showing
4 changed files
with
70 additions
and
42 deletions.
There are no files selected for viewing
21 changes: 0 additions & 21 deletions
21
src/main/resources/alfio/db/HSQLDB/V12_1.5.5__ALTER_CONFIGURATION.sql
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
src/main/resources/alfio/db/HSQLDB/V12_1.5.5__CREATE_CONFIGURATION.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
create table configuration_organization( | ||
id integer identity not null, | ||
organization_id_fk integer not null, | ||
c_key varchar(255) not null, | ||
c_value varchar(2048) not null, | ||
description varchar(2048) | ||
); | ||
alter table configuration_organization add constraint "unique_configuration_organization" unique(organization_id_fk, c_key); | ||
alter table configuration_organization add foreign key(organization_id_fk) references organization(id); | ||
|
||
create table configuration_event( | ||
id integer identity not null, | ||
organization_id_fk integer not null, | ||
event_id_fk integer not null, | ||
c_key varchar(255) not null, | ||
c_value varchar(2048) not null, | ||
description varchar(2048) | ||
); | ||
alter table configuration_event add constraint "unique_configuration_event" unique(organization_id_fk, event_id_fk, c_key); | ||
alter table configuration_event add foreign key(organization_id_fk) references organization(id); | ||
alter table configuration_event add foreign key(event_id_fk) references event(id); | ||
|
||
create table configuration_ticket_category( | ||
id integer identity not null, | ||
organization_id_fk integer not null, | ||
event_id_fk integer not null, | ||
ticket_category_id_fk integer not null, | ||
c_key varchar(255) not null, | ||
c_value varchar(2048) not null, | ||
description varchar(2048) | ||
); | ||
alter table configuration_ticket_category add constraint "unique_configuration_ticket_category" unique(organization_id_fk, event_id_fk, ticket_category_id_fk, c_key); | ||
alter table configuration_ticket_category add foreign key(organization_id_fk) references organization(id); | ||
alter table configuration_ticket_category add foreign key(event_id_fk) references event(id); | ||
alter table configuration_ticket_category add foreign key(ticket_category_id_fk) references ticket_category(id); |
21 changes: 0 additions & 21 deletions
21
src/main/resources/alfio/db/PGSQL/V12_1.5.5__ALTER_CONFIGURATION.sql
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
src/main/resources/alfio/db/PGSQL/V12_1.5.5__CREATE_CONFIGURATION.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
create table configuration_organization( | ||
id serial primary key not null, | ||
organization_id_fk integer not null, | ||
c_key varchar(255) not null, | ||
c_value varchar(2048) not null, | ||
description varchar(2048) | ||
); | ||
alter table configuration_organization add constraint "unique_configuration_organization" unique(organization_id_fk, c_key); | ||
alter table configuration_organization add foreign key(organization_id_fk) references organization(id); | ||
|
||
create table configuration_event( | ||
id serial primary key not null, | ||
organization_id_fk integer not null, | ||
event_id_fk integer not null, | ||
c_key varchar(255) not null, | ||
c_value varchar(2048) not null, | ||
description varchar(2048) | ||
); | ||
alter table configuration_event add constraint "unique_configuration_event" unique(organization_id_fk, event_id_fk, c_key); | ||
alter table configuration_event add foreign key(organization_id_fk) references organization(id); | ||
alter table configuration_event add foreign key(event_id_fk) references event(id); | ||
|
||
create table configuration_ticket_category( | ||
id serial primary key not null, | ||
organization_id_fk integer not null, | ||
event_id_fk integer not null, | ||
ticket_category_id_fk integer not null, | ||
c_key varchar(255) not null, | ||
c_value varchar(2048) not null, | ||
description varchar(2048) | ||
); | ||
alter table configuration_ticket_category add constraint "unique_configuration_ticket_category" unique(organization_id_fk, event_id_fk, ticket_category_id_fk, c_key); | ||
alter table configuration_ticket_category add foreign key(organization_id_fk) references organization(id); | ||
alter table configuration_ticket_category add foreign key(event_id_fk) references event(id); | ||
alter table configuration_ticket_category add foreign key(ticket_category_id_fk) references ticket_category(id); |