Skip to content
Snippets Groups Projects
Commit 5cfbe847 authored by srosse's avatar srosse
Browse files

OO-1000: update setup and alter for postgresql

parent 0a0058b5
No related branches found
No related tags found
No related merge requests found
...@@ -5,9 +5,6 @@ alter table o_repositoryentry alter column softkey type varchar(36); ...@@ -5,9 +5,6 @@ alter table o_repositoryentry alter column softkey type varchar(36);
alter table o_repositoryentry alter column launchcounter drop not null; alter table o_repositoryentry alter column launchcounter drop not null;
alter table o_repositoryentry alter column downloadcounter drop not null; alter table o_repositoryentry alter column downloadcounter drop not null;
alter table o_ep_struct_el add column fk_group_id int8;
-- repository entry statistics table -- repository entry statistics table
create table o_repositoryentry_stats ( create table o_repositoryentry_stats (
id int8 not null, id int8 not null,
...@@ -90,6 +87,28 @@ alter table o_gp_business add constraint gp_to_group_business_ctx foreign key (f ...@@ -90,6 +87,28 @@ alter table o_gp_business add constraint gp_to_group_business_ctx foreign key (f
create index gp_to_group_group_idx on o_gp_business (fk_group_id); create index gp_to_group_group_idx on o_gp_business (fk_group_id);
-- portfolio
alter table o_bs_invitation alter column fk_secgroup drop not null;
alter table o_bs_invitation alter column version drop not null;
alter table o_bs_invitation add column fk_group_id int8;
alter table o_bs_invitation add constraint inv_to_group_group_ctx foreign key (fk_group_id) references o_bs_group (id);
create table o_ep_struct_to_group (
id int8 not null,
creationdate timestamp not null,
r_defgroup boolean not null,
r_role varchar(64),
r_valid_from timestamp,
r_valid_to timestamp,
fk_group_id int8,
fk_struct_id int8,
primary key (id)
);
alter table o_ep_struct_to_group add constraint struct_to_group_group_ctx foreign key (fk_group_id) references o_bs_group (id);
alter table o_ep_struct_to_group add constraint struct_to_group_re_ctx foreign key (fk_struct_id) references o_ep_struct_el (structure_id);
-- managed groups -- managed groups
drop view o_gp_business_v; drop view o_gp_business_v;
create or replace view o_gp_business_v as ( create or replace view o_gp_business_v as (
......
...@@ -641,17 +641,27 @@ create table o_ep_struct_artefact_link ( ...@@ -641,17 +641,27 @@ create table o_ep_struct_artefact_link (
fk_artefact_id int8 not null, fk_artefact_id int8 not null,
primary key (link_id) primary key (link_id)
); );
create table o_ep_struct_to_group (
id int8 not null,
creationdate timestamp not null,
r_defgroup boolean not null,
r_role varchar(64),
r_valid_from timestamp,
r_valid_to timestamp,
fk_group_id int8,
fk_struct_id int8,
primary key (id)
);
-- invitation -- invitation
create table o_bs_invitation ( create table o_bs_invitation (
id int8 not null, id int8 not null,
version int4 not null,
creationdate timestamp, creationdate timestamp,
token varchar(64) not null, token varchar(64) not null,
first_name varchar(64), first_name varchar(64),
last_name varchar(64), last_name varchar(64),
mail varchar(128), mail varchar(128),
fk_secgroup int8, fk_group_id int8,
primary key (id) primary key (id)
); );
...@@ -1848,8 +1858,6 @@ create index identstatus_idx on o_bs_identity (status); ...@@ -1848,8 +1858,6 @@ create index identstatus_idx on o_bs_identity (status);
create index idx_ident_creationdate_idx on o_bs_identity (creationdate); create index idx_ident_creationdate_idx on o_bs_identity (creationdate);
create index idx_id_lastlogin_idx on o_bs_identity (lastlogin); create index idx_id_lastlogin_idx on o_bs_identity (lastlogin);
alter table o_bs_policy add constraint FK9A1C5109F9C3F1D foreign key (oresource_id) references o_olatresource;
create index idx_policy_rsrc_idx on o_bs_policy (oresource_id);
alter table o_bs_policy add constraint FK9A1C5101E2E76DB foreign key (group_id) references o_bs_secgroup; alter table o_bs_policy add constraint FK9A1C5101E2E76DB foreign key (group_id) references o_bs_secgroup;
create index idx_policy_grp_idx on o_bs_policy (group_id); create index idx_policy_grp_idx on o_bs_policy (group_id);
create index idx_policy_grp_rsrc_idx on o_bs_policy (oresource_id, group_id); create index idx_policy_grp_rsrc_idx on o_bs_policy (oresource_id, group_id);
...@@ -1860,8 +1868,8 @@ alter table o_bs_membership add constraint FK7B6288B4B85B522C foreign key (secgr ...@@ -1860,8 +1868,8 @@ alter table o_bs_membership add constraint FK7B6288B4B85B522C foreign key (secgr
create index idx_membership_sec_idx on o_bs_membership (secgroup_id); create index idx_membership_sec_idx on o_bs_membership (secgroup_id);
create index idx_membership_sec_ident_idx on o_bs_membership (identity_id, secgroup_id); create index idx_membership_sec_ident_idx on o_bs_membership (identity_id, secgroup_id);
alter table o_bs_invitation add constraint FKF26C8375236F27X foreign key (fk_secgroup) references o_bs_secgroup (id); alter table o_bs_invitation add constraint inv_to_group_group_ctx foreign key (fk_group_id) references o_bs_group (id);
create index idx_invitation_grp_idx on o_bs_invitation (fk_secgroup); create index idx_inv_to_group_group_ctx on o_bs_invitation (fk_group_id);
create index idx_secgroup_creationdate_idx on o_bs_secgroup (creationdate); create index idx_secgroup_creationdate_idx on o_bs_secgroup (creationdate);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment