Skip to content

Commit

Permalink
#56 refactor+add org level configuration table
Browse files Browse the repository at this point in the history
  • Loading branch information
syjer committed Jun 26, 2015
1 parent 1f44b0f commit 3a5de2d
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 42 deletions.

This file was deleted.

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);

This file was deleted.

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);

0 comments on commit 3a5de2d

Please sign in to comment.