summaryrefslogtreecommitdiffstats
path: root/schema/aur-schema.sql
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-04-04 21:57:01 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2014-04-05 12:21:35 +0200
commitd35cf67f7ba24a6c8f6c27f6f016b6f28c8e9f9b (patch)
tree522f403f26130ddae25a2c7ca9427b3008c891a5 /schema/aur-schema.sql
parentb7941073acec76e5b4f89648aca1413c15eb067f (diff)
downloadaur-d35cf67f7ba24a6c8f6c27f6f016b6f28c8e9f9b.tar.gz
aur-d35cf67f7ba24a6c8f6c27f6f016b6f28c8e9f9b.tar.xz
Store comments on a per-package base basis
Move comments from the Packages table to PackageBases. Sharing comments makes sense since they almost always refer to a source package. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'schema/aur-schema.sql')
-rw-r--r--schema/aur-schema.sql12
1 files changed, 6 insertions, 6 deletions
diff --git a/schema/aur-schema.sql b/schema/aur-schema.sql
index a885b7a3..9426a61d 100644
--- a/schema/aur-schema.sql
+++ b/schema/aur-schema.sql
@@ -171,28 +171,28 @@ CREATE UNIQUE INDEX VoteUsersIDPackageID ON PackageVotes (UsersID, PackageBaseID
--
CREATE TABLE PackageComments (
ID BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
- PackageID INTEGER UNSIGNED NOT NULL,
+ PackageBaseID INTEGER UNSIGNED NOT NULL,
UsersID INTEGER UNSIGNED NULL DEFAULT NULL,
Comments TEXT NOT NULL DEFAULT '',
CommentTS BIGINT UNSIGNED NOT NULL DEFAULT 0,
DelUsersID INTEGER UNSIGNED NULL DEFAULT NULL,
PRIMARY KEY (ID),
INDEX (UsersID),
- INDEX (PackageID),
+ INDEX (PackageBaseID),
FOREIGN KEY (UsersID) REFERENCES Users(ID) ON DELETE SET NULL,
FOREIGN KEY (DelUsersID) REFERENCES Users(ID) ON DELETE CASCADE,
- FOREIGN KEY (PackageID) REFERENCES Packages(ID) ON DELETE CASCADE
+ FOREIGN KEY (PackageBaseID) REFERENCES PackageBases(ID) ON DELETE CASCADE
) ENGINE = InnoDB;
-- Comment addition notifications
--
CREATE TABLE CommentNotify (
- PkgID INTEGER UNSIGNED NOT NULL,
+ PackageBaseID INTEGER UNSIGNED NOT NULL,
UserID INTEGER UNSIGNED NOT NULL,
- FOREIGN KEY (PkgID) REFERENCES Packages(ID) ON DELETE CASCADE,
+ FOREIGN KEY (PackageBaseID) REFERENCES PackageBases(ID) ON DELETE CASCADE,
FOREIGN KEY (UserID) REFERENCES Users(ID) ON DELETE CASCADE
) ENGINE = InnoDB;
-CREATE UNIQUE INDEX NotifyUserIDPkgID ON CommentNotify (UserID, PkgID);
+CREATE UNIQUE INDEX NotifyUserIDPkgID ON CommentNotify (UserID, PackageBaseID);
-- Package name blacklist
--