Skip to content

Commit

Permalink
v1.2.0 Beta 2
Browse files Browse the repository at this point in the history
  • Loading branch information
mutec committed May 28, 2017
1 parent e290508 commit 2771575
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
10 changes: 6 additions & 4 deletions src/install.sql
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ CREATE TABLE cms1_news (
);

-- news TO user
-- since 1.2.0 Beta 2
DROP TABLE IF EXISTS cms1_news_to_user;
CREATE TABLE cms1_news_to_user (
newsID INT(10) NOT NULL,
Expand All @@ -47,8 +48,8 @@ CREATE TABLE cms1_news_to_user (
-- news TO category
DROP TABLE IF EXISTS cms1_news_to_category;
CREATE TABLE cms1_news_to_category (
categoryID INT(10) NOT NULL,
newsID INT(10) NOT NULL,
categoryID INT(10),
newsID INT(10),

PRIMARY KEY (categoryID, newsID)
);
Expand All @@ -74,12 +75,13 @@ ALTER TABLE cms1_news_to_category
ADD FOREIGN KEY (newsID) REFERENCES cms1_news (newsID)
ON DELETE CASCADE;

-- 1.2.0 Beta 2
ALTER TABLE cms1_news_to_user
ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID)
ON DELETE SET NULL;
ON DELETE CASCADE;
ALTER TABLE cms1_news_to_user
ADD FOREIGN KEY (newsID) REFERENCES cms1_news (newsID)
ON DELETE SET NULL;
ON DELETE CASCADE;

-- 1.2.0 Beta 2
ALTER TABLE cms1_news
Expand Down
8 changes: 4 additions & 4 deletions src/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
<packagedescription><![CDATA[Newssystem for Fireball CMS]]></packagedescription>
<packagedescription language="de"><![CDATA[Nachrichtensystem für das Fireball CMS]]></packagedescription>
<version><![CDATA[1.2.0 Beta 2]]></version>
<date><![CDATA[2017-05-09]]></date>
<date><![CDATA[2017-05-28]]></date>
</packageinformation>

<authorinformation>
<author>codeQuake</author>
<author>codeQuake, MysteryCode</author>
<authorurl>https://www.mysterycode.de/</authorurl>
</authorinformation>

<requiredpackages>
<requiredpackage minversion="2.1.0">com.woltlab.wcf</requiredpackage>
<requiredpackage minversion="2.2.0 Beta 1">de.codequake.cms</requiredpackage>
<requiredpackage minversion="2.2.0 Beta 2">de.codequake.cms</requiredpackage>
</requiredpackages>

<excludedpackages>
<excludedpackage version="3.0.0 Alpha 1">com.woltlab.wcf</excludedpackage>
<excludedpackage version="1.0.0">de.voolia.news</excludedpackage>
<excludedpackage version="1.0.0 Alpha 1">de.voolia.news</excludedpackage>
</excludedpackages>

<instructions type="install">
Expand Down
12 changes: 12 additions & 0 deletions src/update.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,15 @@ ALTER TABLE cms1_news ADD COLUMN isDelayed TINYINT(1) NOT NULL DEFAULT 0
ALTER TABLE cms1_news ADD COLUMN hasLabels TINYINT(1) NOT NULL DEFAULT 0;

ALTER TABLE cms1_news ADD FOREIGN KEY (deletedByID) REFERENCES wcf1_user (userID) ON DELETE SET NULL;

-- news TO user
DROP TABLE IF EXISTS cms1_news_to_user;
CREATE TABLE cms1_news_to_user (
newsID INT(10),
userID INT(10),

PRIMARY KEY (userID, newsID)
);

ALTER TABLE cms1_news_to_user ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ON DELETE CASCADE;
ALTER TABLE cms1_news_to_user ADD FOREIGN KEY (newsID) REFERENCES cms1_news (newsID) ON DELETE CASCADE;

0 comments on commit 2771575

Please sign in to comment.