CCM NG/ccm-cms: Added a title field to the side note asset

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4389 8810af33-2d31-482b-a856-94f89814c4df
pull/2/head
jensp 2016-10-18 17:22:47 +00:00
parent e73db29d59
commit dded522313
6 changed files with 210 additions and 34 deletions

View File

@ -45,13 +45,23 @@ public class SideNote extends Asset implements Serializable {
private static final long serialVersionUID = -4566222634780521726L;
@Embedded
@AssociationOverride(
name = "values",
joinTable = @JoinTable(name = "SIDE_NOTE_TITLES",
schema = DB_SCHEMA,
joinColumns = {
@JoinColumn(name = "SIDE_NOTE_ID")
}))
private LocalizedString title;
@Embedded
@AssociationOverride(
name = "values",
joinTable = @JoinTable(name = "SIDE_NOTE_TEXTS",
schema = DB_SCHEMA,
joinColumns = {
@JoinColumn(name = "ASSET_ID")
@JoinColumn(name = "SIDE_NOTE_ID")
}
)
)

View File

@ -237,6 +237,27 @@ alter table CCM_CMS.VIDEO_ASSETS_AUD
alter table CCM_CMS.NOTE_TEXTS
rename to CCM_CMS.SIDE_NOTE_TEXTS;
alter table CCM_CMS.SIDE_NOTE_TEXTS
alter column ASSET_ID RENAME TO SIDE_NOTE_ID;
create table CCM_CMS.SIDE_NOTE_TITLES (
SIDE_NOTE_ID bigint not null,
LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null,
primary key (SIDE_NOTE_ID, LOCALE)
);
create table CCM_CMS.SIDE_NOTE_TITLES_AUD (
REV integer not null,
SIDE_NOTE_ID bigint not null,
LOCALIZED_VALUE longvarchar not null,
LOCALE varchar(255) not null,
REVTYPE tinyint,
REVEND integer,
primary key (REV, SIDE_NOTE_ID, LOCALIZED_VALUE, LOCALE)
);
alter table CCM_CMS.ATTACHMENTS
add column ATTACHMENT_LIST_ID bigint;
@ -357,7 +378,7 @@ alter table CCM_CMS.LEGAL_METADATA_AUD
alter table CCM_CMS.SIDE_NOTE_TEXTS
add constraint FK79g6eg2csjaixrjr2xgael8lm
foreign key (ASSET_ID)
foreign key (SIDE_NOTE_ID)
references CCM_CMS.SIDE_NOTES;
alter table CCM_CMS.RELATED_LINKS
@ -394,3 +415,18 @@ alter table CCM_CMS.VIDEO_ASSETS_AUD
add constraint FKdrx9uu9a03ju7vqvkjretohpk
foreign key (OBJECT_ID, REV)
references CCM_CMS.BINARY_ASSETS_AUD;
alter table CCM_CMS.SIDE_NOTE_TITLES
add constraint FKf8c9mw6p4ijiba77t32uh7i0o
foreign key (SIDE_NOTE_ID)
references CCM_CMS.SIDE_NOTES;
alter table CCM_CMS.SIDE_NOTE_TITLES_AUD
add constraint FKkuw32q22sotku83khh1xda7sf
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.SIDE_NOTE_TITLES_AUD
add constraint FKbqgawobyevpbgxsnbbs9vwooq
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;

View File

@ -235,6 +235,26 @@ alter table CCM_CMS.VIDEO_ASSETS_AUD
alter table CCM_CMS.NOTE_TEXTS
rename to SIDE_NOTE_TEXTS;
alter table CCM_CMS.SIDE_NOTE_TEXTS
rename column ASSET_ID to SIDE_NOTE_ID;
create table CCM_CMS.SIDE_NOTE_TITLES (
SIDE_NOTE_ID int8 not null,
LOCALIZED_VALUE text,
LOCALE varchar(255) not null,
primary key (SIDE_NOTE_ID, LOCALE)
);
create table CCM_CMS.SIDE_NOTE_TITLES_AUD (
REV int4 not null,
SIDE_NOTE_ID int8 not null,
LOCALIZED_VALUE text not null,
LOCALE varchar(255) not null,
REVTYPE int2,
REVEND int4,
primary key (REV, SIDE_NOTE_ID, LOCALIZED_VALUE, LOCALE)
);
alter table CCM_CMS.ATTACHMENTS
add column ATTACHMENT_LIST_ID int8;
@ -355,7 +375,7 @@ alter table CCM_CMS.LEGAL_METADATA_AUD
alter table CCM_CMS.SIDE_NOTE_TEXTS
add constraint FK79g6eg2csjaixrjr2xgael8lm
foreign key (ASSET_ID)
foreign key (SIDE_NOTE_ID)
references CCM_CMS.SIDE_NOTES;
alter table CCM_CMS.RELATED_LINKS
@ -392,3 +412,18 @@ alter table CCM_CMS.VIDEO_ASSETS_AUD
add constraint FKdrx9uu9a03ju7vqvkjretohpk
foreign key (OBJECT_ID, REV)
references CCM_CMS.BINARY_ASSETS_AUD;
alter table CCM_CMS.SIDE_NOTE_TITLES
add constraint FKf8c9mw6p4ijiba77t32uh7i0o
foreign key (SIDE_NOTE_ID)
references CCM_CMS.SIDE_NOTES;
alter table CCM_CMS.SIDE_NOTE_TITLES_AUD
add constraint FKkuw32q22sotku83khh1xda7sf
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.SIDE_NOTE_TITLES_AUD
add constraint FKbqgawobyevpbgxsnbbs9vwooq
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;

View File

@ -6,7 +6,7 @@ DROP SEQUENCE IF EXISTS hibernate_sequence;
CREATE SCHEMA ccm_core;
CREATE SCHEMA ccm_cms;
create table CCM_CMS.ARTICLE_LEADS (
create table CCM_CMS.ARTICLE_LEADS (
OBJECT_ID bigint not null,
LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null,
@ -798,20 +798,37 @@ CREATE SCHEMA ccm_cms;
);
create table CCM_CMS.SIDE_NOTE_TEXTS (
ASSET_ID bigint not null,
SIDE_NOTE_ID bigint not null,
LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null,
primary key (ASSET_ID, LOCALE)
primary key (SIDE_NOTE_ID, LOCALE)
);
create table CCM_CMS.SIDE_NOTE_TEXTS_AUD (
REV integer not null,
ASSET_ID bigint not null,
SIDE_NOTE_ID bigint not null,
LOCALIZED_VALUE longvarchar not null,
LOCALE varchar(255) not null,
REVTYPE tinyint,
REVEND integer,
primary key (REV, ASSET_ID, LOCALIZED_VALUE, LOCALE)
primary key (REV, SIDE_NOTE_ID, LOCALIZED_VALUE, LOCALE)
);
create table CCM_CMS.SIDE_NOTE_TITLES (
SIDE_NOTE_ID bigint not null,
LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null,
primary key (SIDE_NOTE_ID, LOCALE)
);
create table CCM_CMS.SIDE_NOTE_TITLES_AUD (
REV integer not null,
SIDE_NOTE_ID bigint not null,
LOCALIZED_VALUE longvarchar not null,
LOCALE varchar(255) not null,
REVTYPE tinyint,
REVEND integer,
primary key (REV, SIDE_NOTE_ID, LOCALIZED_VALUE, LOCALE)
);
create table CCM_CMS.SIDE_NOTES (
@ -1363,11 +1380,11 @@ CREATE SCHEMA ccm_cms;
SETTING_ID bigint not null,
CONFIGURATION_CLASS varchar(512) not null,
NAME varchar(512) not null,
SETTING_VALUE_DOUBLE double,
SETTING_VALUE_BOOLEAN boolean,
SETTING_VALUE_BIG_DECIMAL decimal(19,2),
SETTING_VALUE_STRING varchar(1024),
SETTING_VALUE_LONG bigint,
SETTING_VALUE_BOOLEAN boolean,
SETTING_VALUE_STRING varchar(1024),
SETTING_VALUE_DOUBLE double,
primary key (SETTING_ID)
);
@ -2229,8 +2246,8 @@ create sequence hibernate_sequence start with 1 increment by 1;
references CCM_CMS.ASSETS_AUD;
alter table CCM_CMS.SIDE_NOTE_TEXTS
add constraint FK3c357rqa9kanmmpaggdapvjli
foreign key (ASSET_ID)
add constraint FK4mvpioee23u1qswmn1fekipoh
foreign key (SIDE_NOTE_ID)
references CCM_CMS.SIDE_NOTES;
alter table CCM_CMS.SIDE_NOTE_TEXTS_AUD
@ -2243,6 +2260,21 @@ create sequence hibernate_sequence start with 1 increment by 1;
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.SIDE_NOTE_TITLES
add constraint FKf8c9mw6p4ijiba77t32uh7i0o
foreign key (SIDE_NOTE_ID)
references CCM_CMS.SIDE_NOTES;
alter table CCM_CMS.SIDE_NOTE_TITLES_AUD
add constraint FKkuw32q22sotku83khh1xda7sf
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.SIDE_NOTE_TITLES_AUD
add constraint FKbqgawobyevpbgxsnbbs9vwooq
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.SIDE_NOTES
add constraint FKea6cikleenmkgw5bwus22mfr3
foreign key (OBJECT_ID)

View File

@ -6,7 +6,7 @@ DROP SEQUENCE IF EXISTS hibernate_sequence;
CREATE SCHEMA ccm_core;
CREATE SCHEMA ccm_cms;
create table CCM_CMS.ARTICLE_LEADS (
create table CCM_CMS.ARTICLE_LEADS (
OBJECT_ID int8 not null,
LOCALIZED_VALUE text,
LOCALE varchar(255) not null,
@ -798,20 +798,37 @@ CREATE SCHEMA ccm_cms;
);
create table CCM_CMS.SIDE_NOTE_TEXTS (
ASSET_ID int8 not null,
SIDE_NOTE_ID int8 not null,
LOCALIZED_VALUE text,
LOCALE varchar(255) not null,
primary key (ASSET_ID, LOCALE)
primary key (SIDE_NOTE_ID, LOCALE)
);
create table CCM_CMS.SIDE_NOTE_TEXTS_AUD (
REV int4 not null,
ASSET_ID int8 not null,
SIDE_NOTE_ID int8 not null,
LOCALIZED_VALUE text not null,
LOCALE varchar(255) not null,
REVTYPE int2,
REVEND int4,
primary key (REV, ASSET_ID, LOCALIZED_VALUE, LOCALE)
primary key (REV, SIDE_NOTE_ID, LOCALIZED_VALUE, LOCALE)
);
create table CCM_CMS.SIDE_NOTE_TITLES (
SIDE_NOTE_ID int8 not null,
LOCALIZED_VALUE text,
LOCALE varchar(255) not null,
primary key (SIDE_NOTE_ID, LOCALE)
);
create table CCM_CMS.SIDE_NOTE_TITLES_AUD (
REV int4 not null,
SIDE_NOTE_ID int8 not null,
LOCALIZED_VALUE text not null,
LOCALE varchar(255) not null,
REVTYPE int2,
REVEND int4,
primary key (REV, SIDE_NOTE_ID, LOCALIZED_VALUE, LOCALE)
);
create table CCM_CMS.SIDE_NOTES (
@ -1363,11 +1380,11 @@ CREATE SCHEMA ccm_cms;
SETTING_ID int8 not null,
CONFIGURATION_CLASS varchar(512) not null,
NAME varchar(512) not null,
SETTING_VALUE_DOUBLE float8,
SETTING_VALUE_BOOLEAN boolean,
SETTING_VALUE_BIG_DECIMAL numeric(19, 2),
SETTING_VALUE_STRING varchar(1024),
SETTING_VALUE_LONG int8,
SETTING_VALUE_BOOLEAN boolean,
SETTING_VALUE_STRING varchar(1024),
SETTING_VALUE_DOUBLE float8,
primary key (SETTING_ID)
);
@ -2229,8 +2246,8 @@ create sequence hibernate_sequence start 1 increment 1;
references CCM_CMS.ASSETS_AUD;
alter table CCM_CMS.SIDE_NOTE_TEXTS
add constraint FK3c357rqa9kanmmpaggdapvjli
foreign key (ASSET_ID)
add constraint FK4mvpioee23u1qswmn1fekipoh
foreign key (SIDE_NOTE_ID)
references CCM_CMS.SIDE_NOTES;
alter table CCM_CMS.SIDE_NOTE_TEXTS_AUD
@ -2243,6 +2260,21 @@ create sequence hibernate_sequence start 1 increment 1;
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.SIDE_NOTE_TITLES
add constraint FKf8c9mw6p4ijiba77t32uh7i0o
foreign key (SIDE_NOTE_ID)
references CCM_CMS.SIDE_NOTES;
alter table CCM_CMS.SIDE_NOTE_TITLES_AUD
add constraint FKkuw32q22sotku83khh1xda7sf
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.SIDE_NOTE_TITLES_AUD
add constraint FKbqgawobyevpbgxsnbbs9vwooq
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.SIDE_NOTES
add constraint FKea6cikleenmkgw5bwus22mfr3
foreign key (OBJECT_ID)

View File

@ -6,8 +6,7 @@ DROP SEQUENCE IF EXISTS hibernate_sequence;
CREATE SCHEMA ccm_core;
CREATE SCHEMA ccm_cms;
create table CCM_CMS.ARTICLE_LEADS (
create table CCM_CMS.ARTICLE_LEADS (
OBJECT_ID bigint not null,
LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null,
@ -799,20 +798,37 @@ CREATE SCHEMA ccm_cms;
);
create table CCM_CMS.SIDE_NOTE_TEXTS (
ASSET_ID bigint not null,
SIDE_NOTE_ID bigint not null,
LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null,
primary key (ASSET_ID, LOCALE)
primary key (SIDE_NOTE_ID, LOCALE)
);
create table CCM_CMS.SIDE_NOTE_TEXTS_AUD (
REV integer not null,
ASSET_ID bigint not null,
SIDE_NOTE_ID bigint not null,
LOCALIZED_VALUE longvarchar not null,
LOCALE varchar(255) not null,
REVTYPE tinyint,
REVEND integer,
primary key (REV, ASSET_ID, LOCALIZED_VALUE, LOCALE)
primary key (REV, SIDE_NOTE_ID, LOCALIZED_VALUE, LOCALE)
);
create table CCM_CMS.SIDE_NOTE_TITLES (
SIDE_NOTE_ID bigint not null,
LOCALIZED_VALUE longvarchar,
LOCALE varchar(255) not null,
primary key (SIDE_NOTE_ID, LOCALE)
);
create table CCM_CMS.SIDE_NOTE_TITLES_AUD (
REV integer not null,
SIDE_NOTE_ID bigint not null,
LOCALIZED_VALUE longvarchar not null,
LOCALE varchar(255) not null,
REVTYPE tinyint,
REVEND integer,
primary key (REV, SIDE_NOTE_ID, LOCALIZED_VALUE, LOCALE)
);
create table CCM_CMS.SIDE_NOTES (
@ -1364,11 +1380,11 @@ CREATE SCHEMA ccm_cms;
SETTING_ID bigint not null,
CONFIGURATION_CLASS varchar(512) not null,
NAME varchar(512) not null,
SETTING_VALUE_DOUBLE double,
SETTING_VALUE_BOOLEAN boolean,
SETTING_VALUE_BIG_DECIMAL decimal(19,2),
SETTING_VALUE_STRING varchar(1024),
SETTING_VALUE_LONG bigint,
SETTING_VALUE_BOOLEAN boolean,
SETTING_VALUE_STRING varchar(1024),
SETTING_VALUE_DOUBLE double,
primary key (SETTING_ID)
);
@ -2230,8 +2246,8 @@ create sequence hibernate_sequence start with 1 increment by 1;
references CCM_CMS.ASSETS_AUD;
alter table CCM_CMS.SIDE_NOTE_TEXTS
add constraint FK3c357rqa9kanmmpaggdapvjli
foreign key (ASSET_ID)
add constraint FK4mvpioee23u1qswmn1fekipoh
foreign key (SIDE_NOTE_ID)
references CCM_CMS.SIDE_NOTES;
alter table CCM_CMS.SIDE_NOTE_TEXTS_AUD
@ -2244,6 +2260,21 @@ create sequence hibernate_sequence start with 1 increment by 1;
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.SIDE_NOTE_TITLES
add constraint FKf8c9mw6p4ijiba77t32uh7i0o
foreign key (SIDE_NOTE_ID)
references CCM_CMS.SIDE_NOTES;
alter table CCM_CMS.SIDE_NOTE_TITLES_AUD
add constraint FKkuw32q22sotku83khh1xda7sf
foreign key (REV)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.SIDE_NOTE_TITLES_AUD
add constraint FKbqgawobyevpbgxsnbbs9vwooq
foreign key (REVEND)
references CCM_CORE.CCM_REVISIONS;
alter table CCM_CMS.SIDE_NOTES
add constraint FKea6cikleenmkgw5bwus22mfr3
foreign key (OBJECT_ID)