Skip to content
Snippets Groups Projects
Commit 05671b21 authored by Thiemo Belmega's avatar Thiemo Belmega
Browse files

Alter schema so that categories can have supercategories

parent a3866ffb
No related branches found
No related tags found
No related merge requests found
......@@ -8,10 +8,13 @@ CREATE TABLE application (
PRIMARY KEY (uuid)
);
CREATE TABLE category (
uuid VARCHAR(64) NOT NULL,
title VARCHAR(128) NOT NULL,
description LONGTEXT,
PRIMARY KEY (uuid)
uuid VARCHAR(64) NOT NULL,
title VARCHAR(128) NOT NULL,
description LONGTEXT,
supercategory VARCHAR(64),
PRIMARY KEY (uuid),
FOREIGN KEY (supercategory) REFERENCES category (uuid)
ON DELETE SET NULL
);
CREATE TABLE feature (
uuid VARCHAR(64) NOT NULL,
......@@ -41,8 +44,11 @@ CREATE TABLE application_has_feature (
INSERT INTO application VALUES ('application-test_id_1', 'Dropbox', 'Dropbox Description');
INSERT INTO application VALUES ('application-test_id_2', 'Box.UP', 'Box.UP Description');
INSERT INTO category VALUES ('category-test_id_11', 'Cloud Speicher', 'Cloud Speicher Description');
INSERT INTO category VALUES ('category-test_id_12', 'Wiki', 'Wiki Description');
INSERT INTO category
VALUES ('category-test_id_13', 'Überkategorie', 'Eine Kategorie zum Testen der Superkategorie-Beziehung', NULL);
INSERT INTO category
VALUES ('category-test_id_11', 'Cloud Speicher', 'Cloud Speicher Description', 'category-test_id_13');
INSERT INTO category VALUES ('category-test_id_12', 'Wiki', 'Wiki Description', 'category-test_id_13');
INSERT INTO feature VALUES ('feature-test_id_21', 'Kalender anlegen', 'Kalender anlegen Description');
INSERT INTO feature VALUES ('feature-test_id_22', 'Termine teilen', 'Termine teilen Description');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment