Skip to content

Instantly share code, notes, and snippets.

@ski7777
Created February 5, 2018 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ski7777/a04164b7290a39e50610d4902bed89ca to your computer and use it in GitHub Desktop.
Save ski7777/a04164b7290a39e50610d4902bed89ca to your computer and use it in GitHub Desktop.
BEGIN TRANSACTION;
CREATE TABLE `sheets` ( `composition_id`INTEGER NOT NULL, `instrument`INTEGER,`uuid`TEXT UNIQUE, FOREIGN KEY (`uuid`) REFERENCES `folder_contents`(`sheet_id`) ON DELETE CASCADE );
INSERT INTO `sheets` (composition_id,instrument,uuid) VALUES (1,1,'49c977f9-774a-4fb4-a624-433065dd5a1f');
INSERT INTO `sheets` (composition_id,instrument,uuid) VALUES (1,4,'6c0705a3-314f-4745-92e4-8f52c033e914');
INSERT INTO `sheets` (composition_id,instrument,uuid) VALUES (2,2,'82c751b5-a5d4-4bc6-b4e7-31932ec9c427');
INSERT INTO `sheets` (composition_id,instrument,uuid) VALUES (2,3,'6e9aa7c6-cb73-44ed-8873-7f0b2a58cf7e');
INSERT INTO `sheets` (composition_id,instrument,uuid) VALUES (1,5,'4089ac43-381e-48be-bb49-f7e8ac00acb9');
CREATE TABLE `properties` (`property` INTEGER NOT NULL UNIQUE, `value` TEXT NOT NULL, `type` TEXT );
CREATE TABLE `instruments` ( `id` INTEGER NOT NULL, `lang` TEXT NOT NULL, `translated` TEXT NOT NULL);
INSERT INTO `instruments` (id,lang,translated) VALUES (1,'en','clarinet 1');
INSERT INTO `instruments` (id,lang,translated) VALUES (1,'de','Klarinette 1');
INSERT INTO `instruments` (id,lang,translated) VALUES (2,'en','clarinet 2');
INSERT INTO `instruments` (id,lang,translated) VALUES (2,'de','Klarinette 2');
INSERT INTO `instruments` (id,lang,translated) VALUES (3,'en','Trumpet 1');
INSERT INTO `instruments` (id,lang,translated) VALUES (3,'de','Tompete 1');
INSERT INTO `instruments` (id,lang,translated) VALUES (4,'en','Trumpet 2');
INSERT INTO `instruments` (id,lang,translated) VALUES (4,'de','Tompete 2');
INSERT INTO `instruments` (id,lang,translated) VALUES (5,'en','Percussion 1');
INSERT INTO `instruments` (id,lang,translated) VALUES (5,'de','Perkussion 1');
CREATE TABLE `folders` ( `id` INTEGER NOT NULL UNIQUE, `name` TEXT NOT NULL );
CREATE TABLE `folder_contents` ( `folder_id` INTEGER, `sheet_id` TEXT, `instrument_id` INTEGER );
CREATE TABLE `compositions` ( `id` INTEGER NOT NULL UNIQUE, `name` TEXT NOT NULL, `author` TEXT, FOREIGN KEY (`id`) REFERENCES `sheets`(`composition_id`) ON DELETE CASCADE );
INSERT INTO `compositions` (id,name,author) VALUES (2,'Nationalhymne','Fallersleben');
INSERT INTO `compositions` (id,name,author) VALUES (1,'Beispielmarsch','Polkakomponist');
COMMIT;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment