diff --git a/src/main/resources/alfio/db/HSQLDB/V12_1.5.5__ALTER_CONFIGURATION.sql b/src/main/resources/alfio/db/HSQLDB/V12_1.5.5__ALTER_CONFIGURATION.sql deleted file mode 100644 index 33d6a8ba51..0000000000 --- a/src/main/resources/alfio/db/HSQLDB/V12_1.5.5__ALTER_CONFIGURATION.sql +++ /dev/null @@ -1,21 +0,0 @@ -create table configuration_event( - id integer identity 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(event_id_fk, c_key); -alter table configuration_event add foreign key(event_id_fk) references event(id); - -create table configuration_ticket_category( - id integer identity 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(event_id_fk, ticket_category_id_fk, c_key); -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); \ No newline at end of file diff --git a/src/main/resources/alfio/db/HSQLDB/V12_1.5.5__CREATE_CONFIGURATION.sql b/src/main/resources/alfio/db/HSQLDB/V12_1.5.5__CREATE_CONFIGURATION.sql new file mode 100644 index 0000000000..d3ccb40cc0 --- /dev/null +++ b/src/main/resources/alfio/db/HSQLDB/V12_1.5.5__CREATE_CONFIGURATION.sql @@ -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); \ No newline at end of file diff --git a/src/main/resources/alfio/db/PGSQL/V12_1.5.5__ALTER_CONFIGURATION.sql b/src/main/resources/alfio/db/PGSQL/V12_1.5.5__ALTER_CONFIGURATION.sql deleted file mode 100644 index 73876dcae7..0000000000 --- a/src/main/resources/alfio/db/PGSQL/V12_1.5.5__ALTER_CONFIGURATION.sql +++ /dev/null @@ -1,21 +0,0 @@ -create table configuration_event( - id serial primary key 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(event_id_fk, c_key); -alter table configuration_event add foreign key(event_id_fk) references event(id); - -create table configuration_ticket_category( - id serial primary key 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(event_id_fk, ticket_category_id_fk, c_key); -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); \ No newline at end of file diff --git a/src/main/resources/alfio/db/PGSQL/V12_1.5.5__CREATE_CONFIGURATION.sql b/src/main/resources/alfio/db/PGSQL/V12_1.5.5__CREATE_CONFIGURATION.sql new file mode 100644 index 0000000000..8f6b52f5ea --- /dev/null +++ b/src/main/resources/alfio/db/PGSQL/V12_1.5.5__CREATE_CONFIGURATION.sql @@ -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); \ No newline at end of file