diff --git a/src/main/resources/database/mysql/alter_15_2_x_to_15_3_0.sql b/src/main/resources/database/mysql/alter_15_2_x_to_15_3_0.sql index a2faa8b5883329bf34c989c806e6f9989f8179f2..2eee3ff45000171d8d6a9d18dd2304891b86a749 100644 --- a/src/main/resources/database/mysql/alter_15_2_x_to_15_3_0.sql +++ b/src/main/resources/database/mysql/alter_15_2_x_to_15_3_0.sql @@ -81,12 +81,12 @@ alter table o_ap_appointment add constraint ap_appointment_meeting_idx foreign k -- Organiation role rights create table o_org_role_to_right ( - id bigint not null auto_increment, - creationdate datetime not null, - o_role varchar(255) not null, - o_right varchar(255) not null, - fk_organisation bigint not null, - primary key (id) + id bigint not null auto_increment, + creationdate datetime not null, + o_role varchar(255) not null, + o_right varchar(255) not null, + fk_organisation bigint not null, + primary key (id) ); alter table o_org_role_to_right add constraint org_role_to_right_to_organisation_idx foreign key (fk_organisation) references o_org_organisation (id); diff --git a/src/main/resources/database/mysql/setupDatabase.sql b/src/main/resources/database/mysql/setupDatabase.sql index f683edb7b4c2e546e07330a12f1d20ac127ec856..121a1d3a8f3c2168f73b4a1927c5a49d1a82d09a 100644 --- a/src/main/resources/database/mysql/setupDatabase.sql +++ b/src/main/resources/database/mysql/setupDatabase.sql @@ -575,7 +575,7 @@ create table if not exists o_bs_membership ( create table if not exists o_plock ( plock_id bigint not null, - version mediumint unsigned not null, + version mediumint unsigned not null, creationdate datetime, asset varchar(255) not null unique, primary key (plock_id) @@ -598,50 +598,50 @@ create table if not exists o_lifecycle ( ); create table if not exists oc_lock ( - lock_id bigint not null, - version mediumint unsigned not null, - creationdate datetime, - identity_fk bigint not null, - asset varchar(120) not null unique, - windowid varchar(32) default null, - primary key (lock_id) + lock_id bigint not null, + version mediumint unsigned not null, + creationdate datetime, + identity_fk bigint not null, + asset varchar(120) not null unique, + windowid varchar(32) default null, + primary key (lock_id) ); create table if not exists o_readmessage ( - id bigint not null, - version mediumint unsigned not null, + id bigint not null, + version mediumint unsigned not null, creationdate datetime, - identity_id bigint not null, - forum_id bigint not null, - message_id bigint not null, - primary key (id) + identity_id bigint not null, + forum_id bigint not null, + message_id bigint not null, + primary key (id) ); create table if not exists o_loggingtable ( - log_id bigint not null, - creationdate datetime, - sourceclass varchar(255), - sessionid varchar(255) not null, - user_id bigint, - actioncrudtype varchar(1) not null, - actionverb varchar(16) not null, - actionobject varchar(32) not null, - simpleduration bigint not null, - resourceadminaction boolean not null, - businesspath varchar(2048), - greatgrandparentrestype varchar(32), - greatgrandparentresid varchar(64), - greatgrandparentresname varchar(255), - grandparentrestype varchar(32), - grandparentresid varchar(64), - grandparentresname varchar(255), - parentrestype varchar(32), - parentresid varchar(64), - parentresname varchar(255), - targetrestype varchar(32), - targetresid varchar(64), - targetresname varchar(255), - primary key (log_id) + log_id bigint not null, + creationdate datetime, + sourceclass varchar(255), + sessionid varchar(255) not null, + user_id bigint, + actioncrudtype varchar(1) not null, + actionverb varchar(16) not null, + actionobject varchar(32) not null, + simpleduration bigint not null, + resourceadminaction boolean not null, + businesspath varchar(2048), + greatgrandparentrestype varchar(32), + greatgrandparentresid varchar(64), + greatgrandparentresname varchar(255), + grandparentrestype varchar(32), + grandparentresid varchar(64), + grandparentresname varchar(255), + parentrestype varchar(32), + parentresid varchar(64), + parentresname varchar(255), + targetrestype varchar(32), + targetresid varchar(64), + targetresname varchar(255), + primary key (log_id) ); create table if not exists o_checklist ( @@ -705,28 +705,28 @@ create table if not exists o_projectbroker_customfields ( ); create table if not exists o_usercomment ( - comment_id bigint not null, - version mediumint unsigned not null, - creationdate datetime, - resname varchar(50) not null, - resid bigint not null, - ressubpath varchar(2048), - creator_id bigint not null, - commenttext longtext, - parent_key bigint, - primary key (comment_id) + comment_id bigint not null, + version mediumint unsigned not null, + creationdate datetime, + resname varchar(50) not null, + resid bigint not null, + ressubpath varchar(2048), + creator_id bigint not null, + commenttext longtext, + parent_key bigint, + primary key (comment_id) ); create table if not exists o_userrating ( - rating_id bigint not null, - version mediumint unsigned not null, - creationdate datetime, - lastmodified datetime, - resname varchar(50) not null, - resid bigint not null, - ressubpath varchar(2048), + rating_id bigint not null, + version mediumint unsigned not null, + creationdate datetime, + lastmodified datetime, + resname varchar(50) not null, + resid bigint not null, + ressubpath varchar(2048), creator_id bigint not null, - rating integer not null, - primary key (rating_id) + rating integer not null, + primary key (rating_id) ); create table o_co_db_entry ( @@ -747,7 +747,7 @@ create table o_co_db_entry ( create table if not exists o_stat_lastupdated ( - lastupdated datetime not null + lastupdated datetime not null ); -- important: initialize with old date! @@ -757,12 +757,12 @@ insert into o_stat_lastupdated values(date('1999-01-01')); -- insert into o_stat_dayofweek (businesspath,resid,day,value) select businesspath,substr(businesspath,locate(':',businesspath)+1,locate(']',businesspath)-locate(':',businesspath)-1) resid,dayofweek(creationdate) day,count(*) cnt from o_loggingtable where actionverb='launch' and actionobject='node' group by businesspath,day; create table if not exists o_stat_dayofweek ( - id bigint unsigned not null auto_increment, - businesspath varchar(2048) not null, - resid bigint not null, - day int not null, - value int not null, - primary key (id) + id bigint unsigned not null auto_increment, + businesspath varchar(2048) not null, + resid bigint not null, + day int not null, + value int not null, + primary key (id) ); create index statdow_resid_idx on o_stat_dayofweek (resid); @@ -771,12 +771,12 @@ create index statdow_resid_idx on o_stat_dayofweek (resid); -- insert into o_stat_hourofday (businesspath,resid,hour,value) select businesspath,substr(businesspath,locate(':',businesspath)+1,locate(']',businesspath)-locate(':',businesspath)-1) resid,hour(creationdate) hour,count(*) cnt from o_loggingtable where actionverb='launch' and actionobject='node' group by businesspath,hour; create table if not exists o_stat_hourofday ( - id bigint unsigned not null auto_increment, - businesspath varchar(2048) not null, - resid bigint not null, - hour int not null, - value int not null, - primary key (id) + id bigint unsigned not null auto_increment, + businesspath varchar(2048) not null, + resid bigint not null, + hour int not null, + value int not null, + primary key (id) ); create index stathod_resid_idx on o_stat_hourofday (resid); @@ -785,12 +785,12 @@ create index stathod_resid_idx on o_stat_hourofday (resid); -- insert into o_stat_weekly (businesspath,resid,week,value) select businesspath,substr(businesspath,locate(':',businesspath)+1,locate(']',businesspath)-locate(':',businesspath)-1) resid,concat(year(creationdate),'-',week(creationdate)) week,count(*) cnt from o_loggingtable where actionverb='launch' and actionobject='node' group by businesspath,week; create table if not exists o_stat_weekly ( - id bigint unsigned not null auto_increment, - businesspath varchar(2048) not null, - resid bigint not null, - week varchar(7) not null, - value int not null, - primary key (id) + id bigint unsigned not null auto_increment, + businesspath varchar(2048) not null, + resid bigint not null, + week varchar(7) not null, + value int not null, + primary key (id) ); create index statwee_resid_idx on o_stat_weekly (resid); @@ -799,12 +799,12 @@ create index statwee_resid_idx on o_stat_weekly (resid); -- insert into o_stat_daily (businesspath,resid,day,value) select businesspath,substr(businesspath,locate(':',businesspath)+1,locate(']',businesspath)-locate(':',businesspath)-1) resid,date(creationdate) day,count(*) cnt from o_loggingtable where actionverb='launch' and actionobject='node' group by businesspath,day; create table if not exists o_stat_daily ( - id bigint unsigned not null auto_increment, - businesspath varchar(2048) not null, - resid bigint not null, - day datetime not null, - value int not null, - primary key (id) + id bigint unsigned not null auto_increment, + businesspath varchar(2048) not null, + resid bigint not null, + day datetime not null, + value int not null, + primary key (id) ); create index statday_resid_idx on o_stat_daily (resid); @@ -871,8 +871,8 @@ create table if not exists o_mail ( mail_id bigint NOT NULL, meta_mail_id varchar(64), creationdate datetime, - lastmodified datetime, - resname varchar(50), + lastmodified datetime, + resname varchar(50), resid bigint, ressubpath varchar(2048), businesspath varchar(2048), @@ -940,28 +940,28 @@ create table if not exists o_ac_offer ( ); create table if not exists o_ac_method ( - method_id bigint NOT NULL, - access_method varchar(32), + method_id bigint NOT NULL, + access_method varchar(32), version mediumint unsigned not null, creationdate datetime, - lastmodified datetime, - is_valid bit default 1, - is_enabled bit default 1, - validfrom datetime, - validto datetime, - primary key (method_id) + lastmodified datetime, + is_valid bit default 1, + is_enabled bit default 1, + validfrom datetime, + validto datetime, + primary key (method_id) ); create table if not exists o_ac_offer_access ( - offer_method_id bigint NOT NULL, + offer_method_id bigint NOT NULL, version mediumint unsigned not null, creationdate datetime, - is_valid bit default 1, - validfrom datetime, - validto datetime, + is_valid bit default 1, + validfrom datetime, + validto datetime, fk_offer_id bigint, fk_method_id bigint, - primary key (offer_method_id) + primary key (offer_method_id) ); create table o_ac_auto_advance_order ( @@ -979,24 +979,24 @@ create table o_ac_auto_advance_order ( -- access cart create table if not exists o_ac_order ( - order_id bigint NOT NULL, + order_id bigint NOT NULL, version mediumint unsigned not null, creationdate datetime, - lastmodified datetime, - is_valid bit default 1, - total_lines_amount DECIMAL(12,4), - total_lines_currency_code VARCHAR(3), - total_amount DECIMAL(12,4), - total_currency_code VARCHAR(3), - discount_amount DECIMAL(12,4), - discount_currency_code VARCHAR(3), - order_status VARCHAR(32) default 'NEW', + lastmodified datetime, + is_valid bit default 1, + total_lines_amount DECIMAL(12,4), + total_lines_currency_code VARCHAR(3), + total_amount DECIMAL(12,4), + total_currency_code VARCHAR(3), + discount_amount DECIMAL(12,4), + discount_currency_code VARCHAR(3), + order_status VARCHAR(32) default 'NEW', fk_delivery_id bigint, - primary key (order_id) + primary key (order_id) ); create table if not exists o_ac_order_part ( - order_part_id bigint NOT NULL, + order_part_id bigint NOT NULL, version mediumint unsigned not null, pos mediumint unsigned, creationdate datetime, @@ -1005,25 +1005,25 @@ create table if not exists o_ac_order_part ( total_amount DECIMAL(12,4), total_currency_code VARCHAR(3), fk_order_id bigint, - primary key (order_part_id) + primary key (order_part_id) ); create table if not exists o_ac_order_line ( - order_item_id bigint NOT NULL, + order_item_id bigint NOT NULL, version mediumint unsigned not null, pos mediumint unsigned, creationdate datetime, - unit_price_amount DECIMAL(12,4), - unit_price_currency_code VARCHAR(3), - total_amount DECIMAL(12,4), - total_currency_code VARCHAR(3), + unit_price_amount DECIMAL(12,4), + unit_price_currency_code VARCHAR(3), + total_amount DECIMAL(12,4), + total_currency_code VARCHAR(3), fk_order_part_id bigint, fk_offer_id bigint, - primary key (order_item_id) + primary key (order_item_id) ); create table if not exists o_ac_transaction ( - transaction_id bigint NOT NULL, + transaction_id bigint NOT NULL, version mediumint unsigned not null, creationdate datetime, trx_status VARCHAR(32) default 'NEW', @@ -1032,7 +1032,7 @@ create table if not exists o_ac_transaction ( fk_order_part_id bigint, fk_order_id bigint, fk_method_id bigint, - primary key (transaction_id) + primary key (transaction_id) ); create table if not exists o_ac_reservation ( @@ -3103,14 +3103,14 @@ create table o_grad_configuration ( -- course disclaimer create table o_course_disclaimer_consent( - id bigint not null auto_increment, - disc_1_accepted boolean not null, - disc_2_accepted boolean not null, - creationdate datetime not null, - lastmodified datetime not null, - fk_repository_entry bigint not null, - fk_identity bigint not null, - primary key (id) + id bigint not null auto_increment, + disc_1_accepted boolean not null, + disc_2_accepted boolean not null, + creationdate datetime not null, + lastmodified datetime not null, + fk_repository_entry bigint not null, + fk_identity bigint not null, + primary key (id) ); -- Appointments @@ -3174,49 +3174,49 @@ create table o_ap_participation ( -- Organiation role rights create table o_org_role_to_right ( - id bigint not null auto_increment, - creationdate datetime not null, - o_role varchar(255) not null, - o_right varchar(255) not null, - fk_organisation bigint not null, - primary key (id) + id bigint not null auto_increment, + creationdate datetime not null, + o_role varchar(255) not null, + o_right varchar(255) not null, + fk_organisation bigint not null, + primary key (id) ); -- Contact tracing create table o_contact_tracing_location ( - id bigserial, - creationdate timestamp not null, - lastmodified timestamp not null, - l_reference varchar(255) not null, - l_titel varchar(255) not null, - l_room varchar(255) not null, - l_building varchar(255) not null, - l_qr_id varchar(255) not null, - l_guests boolean not null, - primary key (id) + id bigint not null auto_increment, + creationdate datetime not null, + lastmodified datetime not null, + l_reference varchar(255) not null, + l_titel varchar(255) not null, + l_room varchar(255) not null, + l_building varchar(255) not null, + l_qr_id varchar(255) not null, + l_guests boolean not null, + primary key (id) ); create table o_contact_tracing_entry ( - id bigserial, - creationdate timestamp not null, - l_deletion_date timestamp not null, - l_start_date timestamp not null, - l_end_date timestamp, - l_nick_name varchar(255), - l_fist_name varchar(255), - l_last_name varchar(255), - l_street varchar(255), - l_extra_line varchar(255), - l_zip_code varchar(255), - l_city varchar(255), - l_email varchar(255), - l_institutional_email varchar(255), - l_generic_email varchar(255), - l_private_phone varchar(255), - l_mobile_phone varchar(255), - l_office_phone varchar(255), - fk_location int8 not null, - primary key (id) + id bigint not null auto_increment, + creationdate datetime not null, + l_deletion_date datetime not null, + l_start_date datetime not null, + l_end_date datetime, + l_nick_name varchar(255), + l_fist_name varchar(255), + l_last_name varchar(255), + l_street varchar(255), + l_extra_line varchar(255), + l_zip_code varchar(255), + l_city varchar(255), + l_email varchar(255), + l_institutional_email varchar(255), + l_generic_email varchar(255), + l_private_phone varchar(255), + l_mobile_phone varchar(255), + l_office_phone varchar(255), + fk_location bigint not null, + primary key (id) ); -- user view @@ -3237,13 +3237,13 @@ create view o_bs_identity_short_v as ( ); create view o_gp_business_to_repository_v as ( - select - grp.group_id as grp_id, - repoentry.repositoryentry_id as re_id, - repoentry.displayname as re_displayname - from o_gp_business as grp - inner join o_re_to_group as relation on (relation.fk_group_id = grp.fk_group_id) - inner join o_repositoryentry as repoentry on (repoentry.repositoryentry_id = relation.fk_entry_id) + select + grp.group_id as grp_id, + repoentry.repositoryentry_id as re_id, + repoentry.displayname as re_displayname + from o_gp_business as grp + inner join o_re_to_group as relation on (relation.fk_group_id = grp.fk_group_id) + inner join o_repositoryentry as repoentry on (repoentry.repositoryentry_id = relation.fk_entry_id) ); create view o_bs_gp_membership_v as ( diff --git a/src/main/resources/database/oracle/alter_15_2_x_to_15_3_0.sql b/src/main/resources/database/oracle/alter_15_2_x_to_15_3_0.sql index 24bf6ffff58c5409dd33f864b8d0648f505a8115..fa8271ec981def811688ba54835a6ee39526edc9 100644 --- a/src/main/resources/database/oracle/alter_15_2_x_to_15_3_0.sql +++ b/src/main/resources/database/oracle/alter_15_2_x_to_15_3_0.sql @@ -80,12 +80,12 @@ create index idx_ap_appointment_meeting_idx on o_ap_appointment(fk_meeting_id); -- Organiation role rights create table o_org_role_to_right ( - id number(20) generated always as identity, - creationdate timestamp not null, - o_role varchar(255) not null, - o_right varchar(255) not null, - fk_organisation number(20) not null, - primary key (id) + id number(20) generated always as identity, + creationdate timestamp not null, + o_role varchar(255) not null, + o_right varchar(255) not null, + fk_organisation number(20) not null, + primary key (id) ); alter table o_org_role_to_right add constraint org_role_to_right_to_organisation_idx foreign key (fk_organisation) references o_org_organisation (id); diff --git a/src/main/resources/database/oracle/setupDatabase.sql b/src/main/resources/database/oracle/setupDatabase.sql index c55dbfc36ff9fbb30aec87b1a3a47275fd4a22b1..2b0b16c6ad2496700e982b806513f305496e77b4 100644 --- a/src/main/resources/database/oracle/setupDatabase.sql +++ b/src/main/resources/database/oracle/setupDatabase.sql @@ -3183,14 +3183,14 @@ create table o_grad_configuration ( -- course disclaimer create table o_course_disclaimer_consent( - id number(20) generated always as identity, - disc_1_accepted boolean not null, - disc_2_accepted boolean not null, - creationdate timestamp not null, - lastmodified timestamp not null, - fk_repository_entry number(20) not null, - fk_identity number(20) not null, - primary key (id) + id number(20) generated always as identity, + disc_1_accepted boolean not null, + disc_2_accepted boolean not null, + creationdate timestamp not null, + lastmodified timestamp not null, + fk_repository_entry number(20) not null, + fk_identity number(20) not null, + primary key (id) ); -- Appointments @@ -3254,12 +3254,12 @@ create table o_ap_participation ( -- Organiation role rights create table o_org_role_to_right ( - id number(20) generated always as identity, - creationdate date not null, - o_role varchar(255) not null, - o_right varchar(255) not null, - fk_organisation number(20) not null, - primary key (id) + id number(20) generated always as identity, + creationdate date not null, + o_role varchar(255) not null, + o_right varchar(255) not null, + fk_organisation number(20) not null, + primary key (id) ); -- Contact tracing @@ -3317,13 +3317,13 @@ create view o_bs_identity_short_v as ( ); create view o_gp_business_to_repository_v as ( - select - grp.group_id as grp_id, - repoentry.repositoryentry_id as re_id, - repoentry.displayname as re_displayname - from o_gp_business grp - inner join o_re_to_group relation on (relation.fk_group_id = grp.fk_group_id) - inner join o_repositoryentry repoentry on (repoentry.repositoryentry_id = relation.fk_entry_id) + select + grp.group_id as grp_id, + repoentry.repositoryentry_id as re_id, + repoentry.displayname as re_displayname + from o_gp_business grp + inner join o_re_to_group relation on (relation.fk_group_id = grp.fk_group_id) + inner join o_repositoryentry repoentry on (repoentry.repositoryentry_id = relation.fk_entry_id) ); create view o_bs_gp_membership_v as ( diff --git a/src/main/resources/database/postgresql/alter_15_2_x_to_15_3_0.sql b/src/main/resources/database/postgresql/alter_15_2_x_to_15_3_0.sql index ae9b1178a70bad7c177659add5b08c773a5c0cd3..d3f69ebd40075b41906b282ee924368e9def2500 100644 --- a/src/main/resources/database/postgresql/alter_15_2_x_to_15_3_0.sql +++ b/src/main/resources/database/postgresql/alter_15_2_x_to_15_3_0.sql @@ -81,12 +81,12 @@ create index idx_ap_appointment_meeting_idx on o_ap_appointment(fk_meeting_id); -- Organiation role rights create table o_org_role_to_right ( - id bigserial, - creationdate timestamp not null, - o_role varchar(255) not null, - o_right varchar(255) not null, - fk_organisation int8 not null, - primary key (id) + id bigserial, + creationdate timestamp not null, + o_role varchar(255) not null, + o_right varchar(255) not null, + fk_organisation int8 not null, + primary key (id) ); alter table o_org_role_to_right add constraint org_role_to_right_to_organisation_idx foreign key (fk_organisation) references o_org_organisation (id); @@ -101,38 +101,38 @@ alter table o_lecture_absence_category add column l_enabled bool default true no -- Contact tracing create table o_contact_tracing_location ( - id bigserial, - creationdate timestamp not null, - lastmodified timestamp not null, - l_reference varchar(255) not null, - l_titel varchar(255) not null, - l_room varchar(255) not null, - l_building varchar(255) not null, - l_qr_id varchar(255) not null, - l_guests boolean not null, - primary key (id) + id bigserial, + creationdate timestamp not null, + lastmodified timestamp not null, + l_reference varchar(255) not null, + l_titel varchar(255) not null, + l_room varchar(255) not null, + l_building varchar(255) not null, + l_qr_id varchar(255) not null, + l_guests boolean not null, + primary key (id) ); create table o_contact_tracing_entry ( - id bigserial, - creationdate timestamp not null, - l_deletion_date timestamp not null, - l_start_date timestamp not null, - l_end_date timestamp, - l_nick_name varchar(255), - l_fist_name varchar(255), - l_last_name varchar(255), - l_street varchar(255), - l_extra_line varchar(255), - l_zip_code varchar(255), - l_city varchar(255), - l_email varchar(255), - l_institutional_email varchar(255), - l_generic_email varchar(255), - l_private_phone varchar(255), - l_mobile_phone varchar(255), - l_office_phone varchar(255), - fk_location int8 not null, - primary key (id) + id bigserial, + creationdate timestamp not null, + l_deletion_date timestamp not null, + l_start_date timestamp not null, + l_end_date timestamp, + l_nick_name varchar(255), + l_fist_name varchar(255), + l_last_name varchar(255), + l_street varchar(255), + l_extra_line varchar(255), + l_zip_code varchar(255), + l_city varchar(255), + l_email varchar(255), + l_institutional_email varchar(255), + l_generic_email varchar(255), + l_private_phone varchar(255), + l_mobile_phone varchar(255), + l_office_phone varchar(255), + fk_location int8 not null, + primary key (id) ); diff --git a/src/main/resources/database/postgresql/setupDatabase.sql b/src/main/resources/database/postgresql/setupDatabase.sql index f881a4ecd9680242011e5d8c12bbe881c544e98d..2d3f7821c514e72c882e663fb16481e70fd986bf 100644 --- a/src/main/resources/database/postgresql/setupDatabase.sql +++ b/src/main/resources/database/postgresql/setupDatabase.sql @@ -593,51 +593,51 @@ create table o_lifecycle ( ); create table oc_lock ( - lock_id int8 not null, - version int4 not null, - creationdate timestamp, - identity_fk int8 not null, - asset varchar(120) not null unique, - windowid varchar(32) default null, - primary key (lock_id) + lock_id int8 not null, + version int4 not null, + creationdate timestamp, + identity_fk int8 not null, + asset varchar(120) not null unique, + windowid varchar(32) default null, + primary key (lock_id) ); alter table oc_lock add constraint FK9E30F4B66115906D foreign key (identity_fk) references o_bs_identity; create table o_readmessage ( - id int8 not null, - version int4 not null, + id int8 not null, + version int4 not null, creationdate timestamp, - identity_id int8 not null, - forum_id int8 not null, - message_id int8 not null, - primary key (id) + identity_id int8 not null, + forum_id int8 not null, + message_id int8 not null, + primary key (id) ); create table o_loggingtable ( - log_id int8 not null, - creationdate timestamp, - sourceclass varchar(255), - sessionid varchar(255) not null, - user_id int8, - actioncrudtype varchar(1) not null, - actionverb varchar(16) not null, - actionobject varchar(32) not null, - simpleduration int8 not null, - resourceadminaction bool not null, - businesspath varchar(2048), - greatgrandparentrestype varchar(32), - greatgrandparentresid varchar(64), - greatgrandparentresname varchar(255), - grandparentrestype varchar(32), - grandparentresid varchar(64), - grandparentresname varchar(255), - parentrestype varchar(32), - parentresid varchar(64), - parentresname varchar(255), - targetrestype varchar(32), - targetresid varchar(64), - targetresname varchar(255), - primary key (log_id) + log_id int8 not null, + creationdate timestamp, + sourceclass varchar(255), + sessionid varchar(255) not null, + user_id int8, + actioncrudtype varchar(1) not null, + actionverb varchar(16) not null, + actionobject varchar(32) not null, + simpleduration int8 not null, + resourceadminaction bool not null, + businesspath varchar(2048), + greatgrandparentrestype varchar(32), + greatgrandparentresid varchar(64), + greatgrandparentresname varchar(255), + grandparentrestype varchar(32), + grandparentresid varchar(64), + grandparentresname varchar(255), + parentrestype varchar(32), + parentresid varchar(64), + parentresname varchar(255), + targetrestype varchar(32), + targetresid varchar(64), + targetresname varchar(255), + primary key (log_id) ); create table o_checklist ( @@ -701,28 +701,28 @@ create table o_projectbroker_customfields ( ); create table o_usercomment ( - comment_id int8 not null, - version int4 not null, - creationdate timestamp, - resname varchar(50) not null, - resid int8 not null, - ressubpath varchar(2048), - creator_id int8 not null, - commenttext text, - parent_key int8, - primary key (comment_id) + comment_id int8 not null, + version int4 not null, + creationdate timestamp, + resname varchar(50) not null, + resid int8 not null, + ressubpath varchar(2048), + creator_id int8 not null, + commenttext text, + parent_key int8, + primary key (comment_id) ); create table o_userrating ( - rating_id int8 not null, - version int4 not null, - creationdate timestamp, - lastmodified timestamp, - resname varchar(50) not null, - resid int8 not null, - ressubpath varchar(2048), - creator_id int8 not null, - rating int4 not null, - primary key (rating_id) + rating_id int8 not null, + version int4 not null, + creationdate timestamp, + lastmodified timestamp, + resname varchar(50) not null, + resid int8 not null, + ressubpath varchar(2048), + creator_id int8 not null, + rating int4 not null, + primary key (rating_id) ); create table o_info_message ( info_id int8 NOT NULL, @@ -788,8 +788,8 @@ create table o_mail ( mail_id int8 not null, meta_mail_id varchar(64), creationdate timestamp, - lastmodified timestamp, - resname varchar(50), + lastmodified timestamp, + resname varchar(50), resid int8, ressubpath varchar(2048), businesspath varchar(2048), @@ -857,28 +857,28 @@ create table o_ac_offer ( ); create table o_ac_method ( - method_id int8 NOT NULL, - access_method varchar(32), + method_id int8 NOT NULL, + access_method varchar(32), version int4 not null, creationdate timestamp, - lastmodified timestamp, - is_valid boolean default true, - is_enabled boolean default true, - validfrom timestamp, - validto timestamp, - primary key (method_id) + lastmodified timestamp, + is_valid boolean default true, + is_enabled boolean default true, + validfrom timestamp, + validto timestamp, + primary key (method_id) ); create table o_ac_offer_access ( - offer_method_id int8 NOT NULL, + offer_method_id int8 NOT NULL, version int4 not null, creationdate timestamp, - is_valid boolean default true, - validfrom timestamp, - validto timestamp, + is_valid boolean default true, + validfrom timestamp, + validto timestamp, fk_offer_id int8, fk_method_id int8, - primary key (offer_method_id) + primary key (offer_method_id) ); create table o_ac_auto_advance_order ( @@ -896,60 +896,60 @@ create table o_ac_auto_advance_order ( -- access cart create table o_ac_order ( - order_id int8 NOT NULL, + order_id int8 NOT NULL, version int4 not null, creationdate timestamp, - lastmodified timestamp, - is_valid boolean default true, - total_lines_amount DECIMAL, - total_lines_currency_code VARCHAR(3), - total_amount DECIMAL, - total_currency_code VARCHAR(3), - discount_amount DECIMAL, - discount_currency_code VARCHAR(3), - order_status VARCHAR(32) default 'NEW', + lastmodified timestamp, + is_valid boolean default true, + total_lines_amount DECIMAL, + total_lines_currency_code VARCHAR(3), + total_amount DECIMAL, + total_currency_code VARCHAR(3), + discount_amount DECIMAL, + discount_currency_code VARCHAR(3), + order_status VARCHAR(32) default 'NEW', fk_delivery_id int8, - primary key (order_id) + primary key (order_id) ); create table o_ac_order_part ( - order_part_id int8 NOT NULL, + order_part_id int8 NOT NULL, version int4 not null, pos int4, creationdate timestamp, total_lines_amount DECIMAL, - total_lines_currency_code VARCHAR(3), - total_amount DECIMAL, - total_currency_code VARCHAR(3), + total_lines_currency_code VARCHAR(3), + total_amount DECIMAL, + total_currency_code VARCHAR(3), fk_order_id int8, - primary key (order_part_id) + primary key (order_part_id) ); create table o_ac_order_line ( - order_item_id int8 NOT NULL, + order_item_id int8 NOT NULL, version int4 not null, pos int4, creationdate timestamp, unit_price_amount DECIMAL, - unit_price_currency_code VARCHAR(3), - total_amount DECIMAL, - total_currency_code VARCHAR(3), + unit_price_currency_code VARCHAR(3), + total_amount DECIMAL, + total_currency_code VARCHAR(3), fk_order_part_id int8, fk_offer_id int8, - primary key (order_item_id) + primary key (order_item_id) ); create table o_ac_transaction ( - transaction_id int8 NOT NULL, + transaction_id int8 NOT NULL, version int4 not null, creationdate timestamp, trx_status VARCHAR(32) default 'NEW', - amount_amount DECIMAL, - amount_currency_code VARCHAR(3), + amount_amount DECIMAL, + amount_currency_code VARCHAR(3), fk_order_part_id int8, fk_order_id int8, fk_method_id int8, - primary key (transaction_id) + primary key (transaction_id) ); create table o_ac_reservation ( @@ -1023,7 +1023,7 @@ create table o_ac_checkout_transaction ( create table o_stat_lastupdated ( - lastupdated timestamp not null + lastupdated timestamp not null ); -- important: initialize with old date! @@ -1033,12 +1033,12 @@ insert into o_stat_lastupdated values(date('1999-01-01')); --insert into o_stat_dayofweek (businesspath,resid,day,value) select businesspath,substr(businesspath,locate(':',businesspath)+1,locate(']',businesspath)-locate(':',businesspath)-1) resid,dayofweek(creationdate) day,count(*) cnt from o_loggingtable where actionverb='launch' and actionobject='node' group by businesspath,day; create table o_stat_dayofweek ( - id bigserial, - businesspath varchar(2048) not null, - resid int8 not null, - day int4 not null, - value int4 not null, - primary key (id) + id bigserial, + businesspath varchar(2048) not null, + resid int8 not null, + day int4 not null, + value int4 not null, + primary key (id) ); create index statdow_resid_idx on o_stat_dayofweek (resid); @@ -1047,12 +1047,12 @@ create index statdow_resid_idx on o_stat_dayofweek (resid); --insert into o_stat_hourofday (businesspath,resid,hour,value) select businesspath,substr(businesspath,locate(':',businesspath)+1,locate(']',businesspath)-locate(':',businesspath)-1) resid,hour(creationdate) hour,count(*) cnt from o_loggingtable where actionverb='launch' and actionobject='node' group by businesspath,hour; create table o_stat_hourofday ( - id bigserial, - businesspath varchar(2048) not null, - resid int8 not null, - hour int4 not null, - value int4 not null, - primary key (id) + id bigserial, + businesspath varchar(2048) not null, + resid int8 not null, + hour int4 not null, + value int4 not null, + primary key (id) ); create index stathod_resid_idx on o_stat_hourofday (resid); @@ -1061,12 +1061,12 @@ create index stathod_resid_idx on o_stat_hourofday (resid); --insert into o_stat_weekly (businesspath,resid,week,value) select businesspath,substr(businesspath,locate(':',businesspath)+1,locate(']',businesspath)-locate(':',businesspath)-1) resid,concat(year(creationdate),'-',week(creationdate)) week,count(*) cnt from o_loggingtable where actionverb='launch' and actionobject='node' group by businesspath,week; create table o_stat_weekly ( - id bigserial, - businesspath varchar(2048) not null, - resid int8 not null, - week varchar(7) not null, - value int4 not null, - primary key (id) + id bigserial, + businesspath varchar(2048) not null, + resid int8 not null, + week varchar(7) not null, + value int4 not null, + primary key (id) ); create index statwee_resid_idx on o_stat_weekly (resid); @@ -1075,12 +1075,12 @@ create index statwee_resid_idx on o_stat_weekly (resid); --insert into o_stat_daily (businesspath,resid,day,value) select businesspath,substr(businesspath,locate(':',businesspath)+1,locate(']',businesspath)-locate(':',businesspath)-1) resid,date(creationdate) day,count(*) cnt from o_loggingtable where actionverb='launch' and actionobject='node' group by businesspath,day; create table o_stat_daily ( - id bigserial, - businesspath varchar(2048) not null, - resid int8 not null, - day timestamp not null, - value int4 not null, - primary key (id) + id bigserial, + businesspath varchar(2048) not null, + resid int8 not null, + day timestamp not null, + value int4 not null, + primary key (id) ); create index statday_resid_idx on o_stat_daily (resid); @@ -1089,12 +1089,12 @@ create index statday_resid_idx on o_stat_daily (resid); --insert into o_stat_studylevel (businesspath,resid,studylevel,value) select businesspath,substr(businesspath,locate(':',businesspath)+1,locate(']',businesspath)-locate(':',businesspath)-1) resid,userproperty3 studylevel,count(*) cnt from o_loggingtable where actionverb='launch' and actionobject='node' group by businesspath,studylevel; create table o_stat_studylevel ( - id bigserial, - businesspath varchar(2048) not null, - resid int8 not null, - studylevel varchar(255) not null, - value int4 not null, - primary key (id) + id bigserial, + businesspath varchar(2048) not null, + resid int8 not null, + studylevel varchar(255) not null, + value int4 not null, + primary key (id) ); create index statstl_resid_idx on o_stat_studylevel (resid); @@ -1103,12 +1103,12 @@ create index statstl_resid_idx on o_stat_studylevel (resid); --insert into o_stat_studybranch3 (businesspath,resid,studybranch3,value) select businesspath,substr(businesspath,locate(':',businesspath)+1,locate(']',businesspath)-locate(':',businesspath)-1) resid,userproperty10 studybranch3,count(*) cnt from o_loggingtable where actionverb='launch' and actionobject='node' group by businesspath,studybranch3; create table o_stat_studybranch3 ( - id bigserial, - businesspath varchar(2048) not null, - resid int8 not null, - studybranch3 varchar(255), - value int4 not null, - primary key (id) + id bigserial, + businesspath varchar(2048) not null, + resid int8 not null, + studybranch3 varchar(255), + value int4 not null, + primary key (id) ); create index statstb_resid_idx on o_stat_studybranch3 (resid); @@ -3125,14 +3125,14 @@ create table o_grad_configuration ( -- course disclaimer create table o_course_disclaimer_consent( - id bigserial, - disc_1_accepted boolean not null, - disc_2_accepted boolean not null, - creationdate timestamp not null, - lastmodified timestamp not null, - fk_repository_entry int8 not null, - fk_identity int8 not null, - primary key (id) + id bigserial, + disc_1_accepted boolean not null, + disc_2_accepted boolean not null, + creationdate timestamp not null, + lastmodified timestamp not null, + fk_repository_entry int8 not null, + fk_identity int8 not null, + primary key (id) ); -- Appointments @@ -3196,49 +3196,49 @@ create table o_ap_participation ( -- Organiation role rights create table o_org_role_to_right ( - id bigserial, - creationdate timestamp not null, - o_role varchar(255) not null, - o_right varchar(255) not null, - fk_organisation int8 not null, - primary key (id) + id bigserial, + creationdate timestamp not null, + o_role varchar(255) not null, + o_right varchar(255) not null, + fk_organisation int8 not null, + primary key (id) ); -- Contact tracing create table o_contact_tracing_location ( - id bigserial, - creationdate timestamp not null, - lastmodified timestamp not null, - l_reference varchar(255) not null, - l_titel varchar(255) not null, - l_room varchar(255) not null, - l_building varchar(255) not null, - l_qr_id varchar(255) not null, - l_guests boolean not null, - primary key (id) + id bigserial, + creationdate timestamp not null, + lastmodified timestamp not null, + l_reference varchar(255) not null, + l_titel varchar(255) not null, + l_room varchar(255) not null, + l_building varchar(255) not null, + l_qr_id varchar(255) not null, + l_guests boolean not null, + primary key (id) ); create table o_contact_tracing_entry ( - id bigserial, - creationdate timestamp not null, - l_deletion_date timestamp not null, - l_start_date timestamp not null, - l_end_date timestamp, - l_nick_name varchar(255), - l_fist_name varchar(255), - l_last_name varchar(255), - l_street varchar(255), - l_extra_line varchar(255), - l_zip_code varchar(255), - l_city varchar(255), - l_email varchar(255), - l_institutional_email varchar(255), - l_generic_email varchar(255), - l_private_phone varchar(255), - l_mobile_phone varchar(255), - l_office_phone varchar(255), - fk_location int8 not null, - primary key (id) + id bigserial, + creationdate timestamp not null, + l_deletion_date timestamp not null, + l_start_date timestamp not null, + l_end_date timestamp, + l_nick_name varchar(255), + l_fist_name varchar(255), + l_last_name varchar(255), + l_street varchar(255), + l_extra_line varchar(255), + l_zip_code varchar(255), + l_city varchar(255), + l_email varchar(255), + l_institutional_email varchar(255), + l_generic_email varchar(255), + l_private_phone varchar(255), + l_mobile_phone varchar(255), + l_office_phone varchar(255), + fk_location int8 not null, + primary key (id) ); -- user view @@ -3260,13 +3260,13 @@ create view o_bs_identity_short_v as ( create view o_gp_business_to_repository_v as ( - select - grp.group_id as grp_id, - repoentry.repositoryentry_id as re_id, - repoentry.displayname as re_displayname - from o_gp_business as grp - inner join o_re_to_group as relation on (relation.fk_group_id = grp.fk_group_id) - inner join o_repositoryentry as repoentry on (repoentry.repositoryentry_id = relation.fk_entry_id) + select + grp.group_id as grp_id, + repoentry.repositoryentry_id as re_id, + repoentry.displayname as re_displayname + from o_gp_business as grp + inner join o_re_to_group as relation on (relation.fk_group_id = grp.fk_group_id) + inner join o_repositoryentry as repoentry on (repoentry.repositoryentry_id = relation.fk_entry_id) ); create view o_bs_gp_membership_v as (