Index: lams_tool_nb/conf/hibernate/mapping/org/lamsfoundation/lams/tool/noticeboard/NoticeboardAttachment.hbm.xml =================================================================== diff -u -r4b24640224b4f7b2315ed767309f0f2895b2af08 -rb1de08420f6004339df63eba3f80e1eac1f09b2e --- lams_tool_nb/conf/hibernate/mapping/org/lamsfoundation/lams/tool/noticeboard/NoticeboardAttachment.hbm.xml (.../NoticeboardAttachment.hbm.xml) (revision 4b24640224b4f7b2315ed767309f0f2895b2af08) +++ lams_tool_nb/conf/hibernate/mapping/org/lamsfoundation/lams/tool/noticeboard/NoticeboardAttachment.hbm.xml (.../NoticeboardAttachment.hbm.xml) (revision b1de08420f6004339df63eba3f80e1eac1f09b2e) @@ -54,14 +54,12 @@ name="uuid" type="java.lang.Long" column="uuid" - not-null="true" length="20" > @hibernate.property column="uuid" length="20" - not-null="true" @hibernate.property - column="is_online" + column="online_file" length="1" not-null="true" - + + + + + + @hibernate.set + lazy="true" + inverse="true" + cascade="all-delete-orphan" + @hibernate.collection-key + column="nb_content_uid" + + @hibernate.collection-one-to-many + class="org.lamsfoundation.lams.tool.noticeboard.NoticeboardAttachment" + + + + + + + + Index: lams_tool_nb/db/sql/create_lams_tool_nb.sql =================================================================== diff -u -re31ea6ddbf8f82fdfc668773ebe28d847ccd4ad1 -rb1de08420f6004339df63eba3f80e1eac1f09b2e --- lams_tool_nb/db/sql/create_lams_tool_nb.sql (.../create_lams_tool_nb.sql) (revision e31ea6ddbf8f82fdfc668773ebe28d847ccd4ad1) +++ lams_tool_nb/db/sql/create_lams_tool_nb.sql (.../create_lams_tool_nb.sql) (revision b1de08420f6004339df63eba3f80e1eac1f09b2e) @@ -45,9 +45,9 @@ attachment_id BIGINT(20) NOT NULL AUTO_INCREMENT , nb_content_uid BIGINT(20) NOT NULL , filename VARCHAR(50) NOT NULL - , uuid BIGINT(20) NOT NULL + , uuid BIGINT(20) , version_id BIGINT(20) - , isOnline TINYINT(1) NOT NULL + , online_file TINYINT(1) NOT NULL , PRIMARY KEY (attachment_id) , INDEX (nb_content_uid) , CONSTRAINT FK_tl_lanb11_attachment_1 FOREIGN KEY (nb_content_uid) Index: lams_tool_nb/db/sql/init_lams_tool_nb.sql =================================================================== diff -u -re31ea6ddbf8f82fdfc668773ebe28d847ccd4ad1 -rb1de08420f6004339df63eba3f80e1eac1f09b2e --- lams_tool_nb/db/sql/init_lams_tool_nb.sql (.../init_lams_tool_nb.sql) (revision e31ea6ddbf8f82fdfc668773ebe28d847ccd4ad1) +++ lams_tool_nb/db/sql/init_lams_tool_nb.sql (.../init_lams_tool_nb.sql) (revision b1de08420f6004339df63eba3f80e1eac1f09b2e) @@ -53,9 +53,9 @@ attachment_id BIGINT(20) NOT NULL AUTO_INCREMENT , nb_content_uid BIGINT(20) NOT NULL , filename VARCHAR(50) NOT NULL - , uuid BIGINT(20) NOT NULL + , uuid BIGINT(20) , version_id BIGINT(20) - , isOnline TINYINT(1) NOT NULL + , online_file TINYINT(1) NOT NULL , PRIMARY KEY (attachment_id) , INDEX (nb_content_uid) , CONSTRAINT FK_tl_lanb11_attachment_1 FOREIGN KEY (nb_content_uid) Index: lams_tool_nb/db/sql/lams_tool_nb.sql =================================================================== diff -u -rcc796564ee86ee3e7427d66c174fa4d407116f7b -rb1de08420f6004339df63eba3f80e1eac1f09b2e --- lams_tool_nb/db/sql/lams_tool_nb.sql (.../lams_tool_nb.sql) (revision cc796564ee86ee3e7427d66c174fa4d407116f7b) +++ lams_tool_nb/db/sql/lams_tool_nb.sql (.../lams_tool_nb.sql) (revision b1de08420f6004339df63eba3f80e1eac1f09b2e) @@ -7,6 +7,7 @@ , offline_instructions TEXT , define_later TINYINT(1) , force_offline TINYINT(1) + , content_in_use TINYINT(1) , creator_user_id BIGINT(20) , date_created DATETIME , date_updated DATETIME @@ -39,3 +40,17 @@ REFERENCES lams.tl_lanb11_session (uid) )TYPE=InnoDB; + +CREATE TABLE lams.tl_lanb11_attachment ( + attachment_id BIGINT(20) NOT NULL AUTO_INCREMENT + , nb_content_uid BIGINT(20) NOT NULL + , filename VARCHAR(50) NOT NULL + , uuid BIGINT(20) + , version_id BIGINT(20) + , online_file TINYINT(1) NOT NULL + , PRIMARY KEY (attachment_id) + , INDEX (nb_content_uid) + , CONSTRAINT FK_tl_lanb11_attachment_1 FOREIGN KEY (nb_content_uid) + REFERENCES lams.tl_lanb11_content (uid) +)TYPE=InnoDB; +