From cc3244ea8ae0202265df3d0fd2cfe86fbbeb9d30 Mon Sep 17 00:00:00 2001
From: Lukas Fleischer <archlinux@cryptocrack.de>
Date: Sat, 26 Apr 2014 14:07:20 +0200
Subject: Store package groups in the database

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
---
 schema/aur-schema.sql | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

(limited to 'schema/aur-schema.sql')

diff --git a/schema/aur-schema.sql b/schema/aur-schema.sql
index c98ba77..ae42fd3 100644
--- a/schema/aur-schema.sql
+++ b/schema/aur-schema.sql
@@ -133,6 +133,27 @@ CREATE TABLE Packages (
 ) ENGINE = InnoDB;
 
 
+-- Information about groups
+--
+CREATE TABLE Groups (
+	ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
+	Name VARCHAR(64) NOT NULL,
+	PRIMARY KEY (ID),
+	UNIQUE (Name)
+) ENGINE = InnoDB;
+
+
+-- Information about package-group-relations
+--
+CREATE TABLE PackageGroups (
+	PackageID INTEGER UNSIGNED NOT NULL,
+	GroupID INTEGER UNSIGNED NOT NULL,
+	PRIMARY KEY (PackageID, GroupID),
+	FOREIGN KEY (PackageID) REFERENCES Packages(ID) ON DELETE CASCADE,
+	FOREIGN KEY (GroupID) REFERENCES Groups(ID) ON DELETE CASCADE
+) ENGINE = InnoDB;
+
+
 -- Define the package dependency types
 --
 CREATE TABLE DependencyTypes (
-- 
cgit v1.2.3-54-g00ecf

