From c209b6f98bf6ff2def37fb33f80bbd0e749b7641 Mon Sep 17 00:00:00 2001 From: celestora Date: Thu, 13 Oct 2022 15:19:44 +0300 Subject: [PATCH] Add playlists sql --- install/sqls/gamma-00000-disco.sql | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/install/sqls/gamma-00000-disco.sql b/install/sqls/gamma-00000-disco.sql index 85796cc4..5039ce8c 100644 --- a/install/sqls/gamma-00000-disco.sql +++ b/install/sqls/gamma-00000-disco.sql @@ -53,3 +53,37 @@ CREATE TABLE IF NOT EXISTS `audio_relations` ( KEY `user` (`entity`) USING BTREE, KEY `entity_audio` (`entity`,`audio`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; + +CREATE TABLE IF NOT EXISTS `playlists` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT, + `owner` bigint NOT NULL, + `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, + `description` varchar(2048) DEFAULT NULL, + `length` int unsigned NOT NULL DEFAULT '0', + `special_type` tinyint unsigned NOT NULL DEFAULT '0', + `created` bigint unsigned DEFAULT NULL, + `edited` bigint unsigned DEFAULT NULL, + `deleted` tinyint unsigned DEFAULT '0', + PRIMARY KEY (`id`), + KEY `owner_deleted` (`owner`,`deleted`), + FULLTEXT KEY `title_description` (`name`,`description`), + FULLTEXT KEY `title` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; + +CREATE TABLE IF NOT EXISTS `playlist_imports` ( + `entity` bigint NOT NULL, + `playlist` bigint unsigned NOT NULL, + `index` bigint unsigned NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`index`) USING BTREE, + KEY `user` (`entity`) USING BTREE, + KEY `entity_audio` (`entity`,`playlist`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; + +CREATE TABLE IF NOT EXISTS `playlist_relations` ( + `collection` bigint unsigned NOT NULL, + `media` bigint unsigned NOT NULL, + `index` bigint unsigned NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`index`) USING BTREE, + KEY `playlist` (`collection`) USING BTREE, + KEY `audio` (`media`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;