Add playlists sql

This commit is contained in:
celestora 2022-10-13 15:19:44 +03:00 committed by GitHub
parent 3e119ccbc6
commit c209b6f98b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,3 +53,37 @@ CREATE TABLE IF NOT EXISTS `audio_relations` (
KEY `user` (`entity`) USING BTREE, KEY `user` (`entity`) USING BTREE,
KEY `entity_audio` (`entity`,`audio`) KEY `entity_audio` (`entity`,`audio`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; ) 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;