summaryrefslogtreecommitdiffstats
path: root/schema/aur-schema.sql
diff options
context:
space:
mode:
Diffstat (limited to 'schema/aur-schema.sql')
-rw-r--r--schema/aur-schema.sql22
1 files changed, 21 insertions, 1 deletions
diff --git a/schema/aur-schema.sql b/schema/aur-schema.sql
index ae42fd3e..85335489 100644
--- a/schema/aur-schema.sql
+++ b/schema/aur-schema.sql
@@ -126,13 +126,33 @@ CREATE TABLE Packages (
Version VARCHAR(32) NOT NULL DEFAULT '',
Description VARCHAR(255) NOT NULL DEFAULT "An Arch Package",
URL VARCHAR(255) NOT NULL DEFAULT "https://www.archlinux.org",
- License VARCHAR(40) NOT NULL DEFAULT '',
PRIMARY KEY (ID),
UNIQUE (Name),
FOREIGN KEY (PackageBaseID) REFERENCES PackageBases(ID) ON DELETE CASCADE
) ENGINE = InnoDB;
+-- Information about licenses
+--
+CREATE TABLE Licenses (
+ ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
+ Name VARCHAR(64) NOT NULL,
+ PRIMARY KEY (ID),
+ UNIQUE (Name)
+) ENGINE = InnoDB;
+
+
+-- Information about package-license-relations
+--
+CREATE TABLE PackageLicenses (
+ PackageID INTEGER UNSIGNED NOT NULL,
+ LicenseID INTEGER UNSIGNED NOT NULL,
+ PRIMARY KEY (PackageID, LicenseID),
+ FOREIGN KEY (PackageID) REFERENCES Packages(ID) ON DELETE CASCADE,
+ FOREIGN KEY (LicenseID) REFERENCES Licenses(ID) ON DELETE CASCADE
+) ENGINE = InnoDB;
+
+
-- Information about groups
--
CREATE TABLE Groups (