"Fossies" - the Fresh Open Source Software Archive

Member "ampache-5.0.0/resources/sql/ampache.sql" (31 Aug 2021, 71067 Bytes) of package /linux/www/ampache-5.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PL/SQL source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 -- GNU Affero General Public License, version 3 (AGPL-3.0-or-later)
    2 -- Copyright 2001 - 2020 Ampache.org
    3 --
    4 -- This program is free software: you can redistribute it and/or modify
    5 -- it under the terms of the GNU Affero General Public License as published by
    6 -- the Free Software Foundation, either version 3 of the License, or
    7 -- (at your option) any later version.
    8 --
    9 -- This program is distributed in the hope that it will be useful,
   10 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
   11 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   12 -- GNU Affero General Public License for more details.
   13 --
   14 -- You should have received a copy of the GNU Affero General Public License
   15 -- along with this program.  If not, see <https://www.gnu.org/licenses/>.
   16 
   17 -- phpMyAdmin SQL Dump
   18 -- version 5.0.1
   19 -- https://www.phpmyadmin.net/
   20 --
   21 -- Host: 192.168.1.20
   22 -- Generation Time: Aug 31, 2021 at 11:56 AM
   23 -- Server version: 10.5.11-MariaDB-1
   24 -- PHP Version: 7.4.21
   25 
   26 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
   27 SET AUTOCOMMIT = 0;
   28 START TRANSACTION;
   29 SET time_zone = "+00:00";
   30 
   31 
   32 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
   33 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
   34 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
   35 /*!40101 SET NAMES utf8mb4 */;
   36 
   37 --
   38 -- Database: `ampache5`
   39 --
   40 
   41 -- --------------------------------------------------------
   42 
   43 --
   44 -- Table structure for table `access_list`
   45 --
   46 
   47 DROP TABLE IF EXISTS `access_list`;
   48 CREATE TABLE IF NOT EXISTS `access_list` (
   49   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
   50   `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   51   `start` varbinary(255) NOT NULL,
   52   `end` varbinary(255) NOT NULL,
   53   `level` smallint(3) UNSIGNED NOT NULL DEFAULT 5,
   54   `type` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   55   `user` int(11) NOT NULL,
   56   `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
   57   PRIMARY KEY (`id`),
   58   KEY `start` (`start`),
   59   KEY `end` (`end`),
   60   KEY `level` (`level`),
   61   KEY `enabled` (`enabled`)
   62 ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
   63 
   64 --
   65 -- Dumping data for table `access_list`
   66 --
   67 
   68 INSERT INTO `access_list` (`id`, `name`, `start`, `end`, `level`, `type`, `user`, `enabled`) VALUES
   69 (1, 'DEFAULTv4', 0x00000000, 0xffffffff, 75, 'interface', -1, 1),
   70 (2, 'DEFAULTv4', 0x00000000, 0xffffffff, 75, 'stream', -1, 1),
   71 (3, 'DEFAULTv4', 0x00000000, 0xffffffff, 75, 'rpc', -1, 1),
   72 (4, 'DEFAULTv6', 0x00000000000000000000000000000000, 0xffffffffffffffff, 75, 'interface', -1, 1),
   73 (5, 'DEFAULTv6', 0x00000000000000000000000000000000, 0xffffffffffffffff, 75, 'stream', -1, 1),
   74 (6, 'DEFAULTv6', 0x00000000000000000000000000000000, 0xffffffffffffffff, 75, 'rpc', -1, 1);
   75 
   76 -- --------------------------------------------------------
   77 
   78 --
   79 -- Table structure for table `album`
   80 --
   81 
   82 DROP TABLE IF EXISTS `album`;
   83 CREATE TABLE IF NOT EXISTS `album` (
   84   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
   85   `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   86   `prefix` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   87   `mbid` varchar(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   88   `year` int(4) UNSIGNED NOT NULL DEFAULT 1984,
   89   `disk` smallint(5) UNSIGNED DEFAULT NULL,
   90   `mbid_group` varchar(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   91   `release_type` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   92   `album_artist` int(11) UNSIGNED DEFAULT NULL,
   93   `original_year` int(4) DEFAULT NULL,
   94   `barcode` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   95   `catalog_number` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   96   `time` bigint(20) UNSIGNED DEFAULT NULL,
   97   `release_status` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   98   `addition_time` int(11) UNSIGNED DEFAULT 0,
   99   `catalog` int(11) UNSIGNED NOT NULL DEFAULT 0,
  100   `total_count` int(11) UNSIGNED NOT NULL DEFAULT 0,
  101   `song_count` smallint(5) UNSIGNED DEFAULT 0,
  102   `artist_count` smallint(5) UNSIGNED DEFAULT 0,
  103   PRIMARY KEY (`id`),
  104   KEY `name` (`name`),
  105   KEY `year` (`year`),
  106   KEY `disk` (`disk`)
  107 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  108 
  109 -- --------------------------------------------------------
  110 
  111 --
  112 -- Table structure for table `artist`
  113 --
  114 
  115 DROP TABLE IF EXISTS `artist`;
  116 CREATE TABLE IF NOT EXISTS `artist` (
  117   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  118   `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  119   `prefix` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  120   `mbid` varchar(1369) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  121   `summary` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  122   `placeformed` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  123   `yearformed` int(4) DEFAULT NULL,
  124   `last_update` int(11) UNSIGNED NOT NULL DEFAULT 0,
  125   `user` int(11) DEFAULT NULL,
  126   `manual_update` smallint(1) DEFAULT 0,
  127   `time` int(11) UNSIGNED DEFAULT NULL,
  128   `song_count` smallint(5) UNSIGNED DEFAULT 0,
  129   `album_count` smallint(5) UNSIGNED DEFAULT 0,
  130   `album_group_count` smallint(5) UNSIGNED DEFAULT 0,
  131   `total_count` int(11) UNSIGNED NOT NULL DEFAULT 0,
  132   PRIMARY KEY (`id`),
  133   KEY `name` (`name`)
  134 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  135 
  136 -- --------------------------------------------------------
  137 
  138 --
  139 -- Table structure for table `bookmark`
  140 --
  141 
  142 DROP TABLE IF EXISTS `bookmark`;
  143 CREATE TABLE IF NOT EXISTS `bookmark` (
  144   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  145   `user` int(11) NOT NULL,
  146   `position` int(11) UNSIGNED NOT NULL DEFAULT 0,
  147   `comment` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  148   `object_type` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  149   `object_id` int(11) UNSIGNED NOT NULL,
  150   `creation_date` int(11) UNSIGNED NOT NULL DEFAULT 0,
  151   `update_date` int(11) UNSIGNED NOT NULL DEFAULT 0,
  152   PRIMARY KEY (`id`)
  153 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  154 
  155 -- --------------------------------------------------------
  156 
  157 --
  158 -- Table structure for table `broadcast`
  159 --
  160 
  161 DROP TABLE IF EXISTS `broadcast`;
  162 CREATE TABLE IF NOT EXISTS `broadcast` (
  163   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  164   `user` int(11) UNSIGNED NOT NULL,
  165   `name` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  166   `description` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  167   `is_private` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  168   `song` int(11) UNSIGNED NOT NULL DEFAULT 0,
  169   `started` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  170   `listeners` int(11) UNSIGNED NOT NULL DEFAULT 0,
  171   `key` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  172   PRIMARY KEY (`id`)
  173 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  174 
  175 -- --------------------------------------------------------
  176 
  177 --
  178 -- Table structure for table `cache_object_count`
  179 --
  180 
  181 DROP TABLE IF EXISTS `cache_object_count`;
  182 CREATE TABLE IF NOT EXISTS `cache_object_count` (
  183   `object_id` int(11) UNSIGNED NOT NULL,
  184   `object_type` enum('album','artist','song','playlist','genre','catalog','live_stream','video','podcast_episode') COLLATE utf8mb4_unicode_ci NOT NULL,
  185   `count` int(11) UNSIGNED NOT NULL DEFAULT 0,
  186   `threshold` int(11) UNSIGNED NOT NULL DEFAULT 0,
  187   `count_type` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL,
  188   PRIMARY KEY (`object_id`,`object_type`,`threshold`,`count_type`)
  189 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  190 
  191 -- --------------------------------------------------------
  192 
  193 --
  194 -- Table structure for table `cache_object_count_run`
  195 --
  196 
  197 DROP TABLE IF EXISTS `cache_object_count_run`;
  198 CREATE TABLE IF NOT EXISTS `cache_object_count_run` (
  199   `object_id` int(11) UNSIGNED NOT NULL,
  200   `object_type` enum('album','artist','song','playlist','genre','catalog','live_stream','video','podcast_episode') COLLATE utf8mb4_unicode_ci NOT NULL,
  201   `count` int(11) UNSIGNED NOT NULL DEFAULT 0,
  202   `threshold` int(11) UNSIGNED NOT NULL DEFAULT 0,
  203   `count_type` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL,
  204   PRIMARY KEY (`object_id`,`object_type`,`threshold`,`count_type`)
  205 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  206 
  207 -- --------------------------------------------------------
  208 
  209 --
  210 -- Table structure for table `catalog`
  211 --
  212 
  213 DROP TABLE IF EXISTS `catalog`;
  214 CREATE TABLE IF NOT EXISTS `catalog` (
  215   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  216   `name` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  217   `catalog_type` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  218   `last_update` int(11) UNSIGNED NOT NULL DEFAULT 0,
  219   `last_clean` int(11) UNSIGNED DEFAULT NULL,
  220   `last_add` int(11) UNSIGNED NOT NULL DEFAULT 0,
  221   `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  222   `rename_pattern` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  223   `sort_pattern` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  224   `gather_types` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  225   `filter_user` int(11) UNSIGNED NOT NULL DEFAULT 0,
  226   PRIMARY KEY (`id`),
  227   KEY `enabled` (`enabled`)
  228 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  229 
  230 -- --------------------------------------------------------
  231 
  232 --
  233 -- Table structure for table `catalog_local`
  234 --
  235 
  236 DROP TABLE IF EXISTS `catalog_local`;
  237 CREATE TABLE IF NOT EXISTS `catalog_local` (
  238   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  239   `path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  240   `catalog_id` int(11) NOT NULL,
  241   PRIMARY KEY (`id`)
  242 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  243 
  244 -- --------------------------------------------------------
  245 
  246 --
  247 -- Table structure for table `catalog_map`
  248 --
  249 
  250 DROP TABLE IF EXISTS `catalog_map`;
  251 CREATE TABLE IF NOT EXISTS `catalog_map` (
  252   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  253   `catalog_id` int(11) UNSIGNED NOT NULL,
  254   `object_id` int(11) UNSIGNED NOT NULL,
  255   `object_type` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  256   PRIMARY KEY (`id`),
  257   UNIQUE KEY `unique_catalog_map` (`object_id`,`object_type`,`catalog_id`)
  258 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  259 
  260 -- --------------------------------------------------------
  261 
  262 --
  263 -- Table structure for table `catalog_remote`
  264 --
  265 
  266 DROP TABLE IF EXISTS `catalog_remote`;
  267 CREATE TABLE IF NOT EXISTS `catalog_remote` (
  268   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  269   `uri` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  270   `username` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  271   `password` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  272   `catalog_id` int(11) NOT NULL,
  273   PRIMARY KEY (`id`)
  274 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  275 
  276 -- --------------------------------------------------------
  277 
  278 --
  279 -- Table structure for table `channel`
  280 --
  281 
  282 DROP TABLE IF EXISTS `channel`;
  283 CREATE TABLE IF NOT EXISTS `channel` (
  284   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  285   `name` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  286   `description` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  287   `url` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  288   `interface` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  289   `port` int(11) UNSIGNED NOT NULL DEFAULT 0,
  290   `fixed_endpoint` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  291   `object_type` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  292   `object_id` int(11) UNSIGNED NOT NULL,
  293   `is_private` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  294   `random` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  295   `loop` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  296   `admin_password` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  297   `start_date` int(11) UNSIGNED NOT NULL DEFAULT 0,
  298   `max_listeners` int(11) UNSIGNED NOT NULL DEFAULT 0,
  299   `peak_listeners` int(11) UNSIGNED NOT NULL DEFAULT 0,
  300   `listeners` int(11) UNSIGNED NOT NULL DEFAULT 0,
  301   `connections` int(11) UNSIGNED NOT NULL DEFAULT 0,
  302   `stream_type` varchar(8) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  303   `bitrate` int(11) UNSIGNED NOT NULL DEFAULT 128,
  304   `pid` int(11) UNSIGNED NOT NULL DEFAULT 0,
  305   PRIMARY KEY (`id`)
  306 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  307 
  308 -- --------------------------------------------------------
  309 
  310 --
  311 -- Table structure for table `clip`
  312 --
  313 
  314 DROP TABLE IF EXISTS `clip`;
  315 CREATE TABLE IF NOT EXISTS `clip` (
  316   `id` int(11) UNSIGNED NOT NULL,
  317   `artist` int(11) DEFAULT NULL,
  318   `song` int(11) DEFAULT NULL,
  319   PRIMARY KEY (`id`)
  320 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  321 
  322 -- --------------------------------------------------------
  323 
  324 --
  325 -- Table structure for table `daap_session`
  326 --
  327 
  328 DROP TABLE IF EXISTS `daap_session`;
  329 CREATE TABLE IF NOT EXISTS `daap_session` (
  330   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  331   `creationdate` int(11) UNSIGNED NOT NULL,
  332   PRIMARY KEY (`id`)
  333 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  334 
  335 -- --------------------------------------------------------
  336 
  337 --
  338 -- Table structure for table `deleted_podcast_episode`
  339 --
  340 
  341 DROP TABLE IF EXISTS `deleted_podcast_episode`;
  342 CREATE TABLE IF NOT EXISTS `deleted_podcast_episode` (
  343   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  344   `addition_time` int(11) UNSIGNED NOT NULL,
  345   `delete_time` int(11) UNSIGNED NOT NULL,
  346   `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  347   `file` varchar(4096) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  348   `catalog` int(11) UNSIGNED NOT NULL,
  349   `total_count` int(11) UNSIGNED NOT NULL DEFAULT 0,
  350   `total_skip` int(11) UNSIGNED NOT NULL DEFAULT 0,
  351   `podcast` int(11) NOT NULL,
  352   PRIMARY KEY (`id`)
  353 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  354 
  355 -- --------------------------------------------------------
  356 
  357 --
  358 -- Table structure for table `deleted_song`
  359 --
  360 
  361 DROP TABLE IF EXISTS `deleted_song`;
  362 CREATE TABLE IF NOT EXISTS `deleted_song` (
  363   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  364   `addition_time` int(11) UNSIGNED DEFAULT 0,
  365   `delete_time` int(11) UNSIGNED DEFAULT 0,
  366   `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  367   `file` varchar(4096) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  368   `catalog` int(11) UNSIGNED NOT NULL DEFAULT 0,
  369   `total_count` int(11) UNSIGNED NOT NULL DEFAULT 0,
  370   `total_skip` int(11) UNSIGNED NOT NULL DEFAULT 0,
  371   `update_time` int(11) UNSIGNED DEFAULT 0,
  372   `album` int(11) UNSIGNED NOT NULL DEFAULT 0,
  373   `artist` int(11) UNSIGNED NOT NULL DEFAULT 0,
  374   PRIMARY KEY (`id`)
  375 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  376 
  377 -- --------------------------------------------------------
  378 
  379 --
  380 -- Table structure for table `deleted_video`
  381 --
  382 
  383 DROP TABLE IF EXISTS `deleted_video`;
  384 CREATE TABLE IF NOT EXISTS `deleted_video` (
  385   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  386   `addition_time` int(11) UNSIGNED NOT NULL,
  387   `delete_time` int(11) UNSIGNED NOT NULL,
  388   `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  389   `file` varchar(4096) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  390   `catalog` int(11) UNSIGNED NOT NULL,
  391   `total_count` int(11) UNSIGNED NOT NULL DEFAULT 0,
  392   `total_skip` int(11) UNSIGNED NOT NULL DEFAULT 0,
  393   PRIMARY KEY (`id`)
  394 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  395 
  396 -- --------------------------------------------------------
  397 
  398 --
  399 -- Table structure for table `democratic`
  400 --
  401 
  402 DROP TABLE IF EXISTS `democratic`;
  403 CREATE TABLE IF NOT EXISTS `democratic` (
  404   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  405   `name` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  406   `cooldown` int(11) UNSIGNED DEFAULT NULL,
  407   `level` tinyint(4) UNSIGNED NOT NULL DEFAULT 25,
  408   `user` int(11) NOT NULL,
  409   `primary` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  410   `base_playlist` int(11) UNSIGNED NOT NULL,
  411   PRIMARY KEY (`id`),
  412   KEY `level` (`level`),
  413   KEY `primary_2` (`primary`)
  414 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  415 
  416 -- --------------------------------------------------------
  417 
  418 --
  419 -- Table structure for table `image`
  420 --
  421 
  422 DROP TABLE IF EXISTS `image`;
  423 CREATE TABLE IF NOT EXISTS `image` (
  424   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  425   `image` mediumblob DEFAULT NULL,
  426   `width` int(4) UNSIGNED DEFAULT 0,
  427   `height` int(4) UNSIGNED DEFAULT 0,
  428   `mime` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  429   `size` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  430   `object_type` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  431   `object_id` int(11) UNSIGNED NOT NULL,
  432   `kind` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  433   PRIMARY KEY (`id`),
  434   KEY `object_type` (`object_type`),
  435   KEY `object_id` (`object_id`)
  436 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  437 
  438 -- --------------------------------------------------------
  439 
  440 --
  441 -- Table structure for table `ip_history`
  442 --
  443 
  444 DROP TABLE IF EXISTS `ip_history`;
  445 CREATE TABLE IF NOT EXISTS `ip_history` (
  446   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  447   `user` int(11) NOT NULL,
  448   `ip` varbinary(255) DEFAULT NULL,
  449   `date` int(11) UNSIGNED NOT NULL DEFAULT 0,
  450   `agent` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  451   PRIMARY KEY (`id`),
  452   KEY `username` (`user`),
  453   KEY `date` (`date`),
  454   KEY `ip` (`ip`)
  455 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  456 
  457 -- --------------------------------------------------------
  458 
  459 --
  460 -- Table structure for table `label`
  461 --
  462 
  463 DROP TABLE IF EXISTS `label`;
  464 CREATE TABLE IF NOT EXISTS `label` (
  465   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  466   `name` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  467   `category` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  468   `summary` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  469   `address` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  470   `email` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  471   `website` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  472   `user` int(11) UNSIGNED DEFAULT NULL,
  473   `creation_date` int(11) UNSIGNED DEFAULT NULL,
  474   `mbid` varchar(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  475   `country` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  476   `active` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
  477   PRIMARY KEY (`id`)
  478 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  479 
  480 -- --------------------------------------------------------
  481 
  482 --
  483 -- Table structure for table `label_asso`
  484 --
  485 
  486 DROP TABLE IF EXISTS `label_asso`;
  487 CREATE TABLE IF NOT EXISTS `label_asso` (
  488   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  489   `label` int(11) UNSIGNED NOT NULL,
  490   `artist` int(11) UNSIGNED NOT NULL,
  491   `creation_date` int(11) UNSIGNED DEFAULT NULL,
  492   PRIMARY KEY (`id`)
  493 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  494 
  495 -- --------------------------------------------------------
  496 
  497 --
  498 -- Table structure for table `license`
  499 --
  500 
  501 DROP TABLE IF EXISTS `license`;
  502 CREATE TABLE IF NOT EXISTS `license` (
  503   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  504   `name` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  505   `description` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  506   `external_link` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  507   PRIMARY KEY (`id`)
  508 ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  509 
  510 --
  511 -- Dumping data for table `license`
  512 --
  513 
  514 INSERT INTO `license` (`id`, `name`, `description`, `external_link`) VALUES
  515 (1, '0 - default', NULL, ''),
  516 (2, 'CC BY', NULL, 'https://creativecommons.org/licenses/by/3.0/'),
  517 (3, 'CC BY NC', NULL, 'https://creativecommons.org/licenses/by-nc/3.0/'),
  518 (4, 'CC BY NC ND', NULL, 'https://creativecommons.org/licenses/by-nc-nd/3.0/'),
  519 (5, 'CC BY NC SA', NULL, 'https://creativecommons.org/licenses/by-nc-sa/3.0/'),
  520 (6, 'CC BY ND', NULL, 'https://creativecommons.org/licenses/by-nd/3.0/'),
  521 (7, 'CC BY SA', NULL, 'https://creativecommons.org/licenses/by-sa/3.0/'),
  522 (8, 'Licence Art Libre', NULL, 'http://artlibre.org/licence/lal/'),
  523 (9, 'Yellow OpenMusic', NULL, 'http://openmusic.linuxtag.org/yellow.html'),
  524 (10, 'Green OpenMusic', NULL, 'http://openmusic.linuxtag.org/green.html'),
  525 (11, 'Gnu GPL Art', NULL, 'http://gnuart.org/english/gnugpl.html'),
  526 (12, 'WTFPL', NULL, 'https://en.wikipedia.org/wiki/WTFPL'),
  527 (13, 'FMPL', NULL, 'http://www.fmpl.org/fmpl.html'),
  528 (14, 'C Reaction', NULL, 'http://morne.free.fr/Necktar7/creaction.htm');
  529 
  530 -- --------------------------------------------------------
  531 
  532 --
  533 -- Table structure for table `live_stream`
  534 --
  535 
  536 DROP TABLE IF EXISTS `live_stream`;
  537 CREATE TABLE IF NOT EXISTS `live_stream` (
  538   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  539   `name` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  540   `site_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  541   `url` varchar(4096) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  542   `genre` int(11) UNSIGNED NOT NULL DEFAULT 0,
  543   `catalog` int(11) UNSIGNED NOT NULL DEFAULT 0,
  544   `codec` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  545   PRIMARY KEY (`id`),
  546   KEY `catalog` (`catalog`),
  547   KEY `genre` (`genre`),
  548   KEY `name` (`name`)
  549 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  550 
  551 -- --------------------------------------------------------
  552 
  553 --
  554 -- Table structure for table `localplay_httpq`
  555 --
  556 
  557 DROP TABLE IF EXISTS `localplay_httpq`;
  558 CREATE TABLE IF NOT EXISTS `localplay_httpq` (
  559   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  560   `name` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  561   `owner` int(11) NOT NULL,
  562   `host` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  563   `port` int(11) UNSIGNED NOT NULL,
  564   `password` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  565   `access` smallint(4) UNSIGNED NOT NULL DEFAULT 0,
  566   PRIMARY KEY (`id`)
  567 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  568 
  569 -- --------------------------------------------------------
  570 
  571 --
  572 -- Table structure for table `localplay_mpd`
  573 --
  574 
  575 DROP TABLE IF EXISTS `localplay_mpd`;
  576 CREATE TABLE IF NOT EXISTS `localplay_mpd` (
  577   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  578   `name` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  579   `owner` int(11) NOT NULL,
  580   `host` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  581   `port` int(11) UNSIGNED NOT NULL DEFAULT 6600,
  582   `password` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  583   `access` smallint(4) UNSIGNED NOT NULL DEFAULT 0,
  584   PRIMARY KEY (`id`)
  585 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  586 
  587 -- --------------------------------------------------------
  588 
  589 --
  590 -- Table structure for table `metadata`
  591 --
  592 
  593 DROP TABLE IF EXISTS `metadata`;
  594 CREATE TABLE IF NOT EXISTS `metadata` (
  595   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  596   `object_id` int(11) UNSIGNED NOT NULL,
  597   `field` int(11) UNSIGNED NOT NULL,
  598   `data` text COLLATE utf8mb4_unicode_ci NOT NULL,
  599   `type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  600   PRIMARY KEY (`id`),
  601   KEY `field` (`field`),
  602   KEY `object_id` (`object_id`),
  603   KEY `type` (`type`),
  604   KEY `objecttype` (`object_id`,`type`),
  605   KEY `objectfield` (`object_id`,`field`,`type`)
  606 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  607 
  608 -- --------------------------------------------------------
  609 
  610 --
  611 -- Table structure for table `metadata_field`
  612 --
  613 
  614 DROP TABLE IF EXISTS `metadata_field`;
  615 CREATE TABLE IF NOT EXISTS `metadata_field` (
  616   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  617   `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  618   `public` tinyint(1) NOT NULL,
  619   PRIMARY KEY (`id`),
  620   UNIQUE KEY `name` (`name`)
  621 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  622 
  623 -- --------------------------------------------------------
  624 
  625 --
  626 -- Table structure for table `movie`
  627 --
  628 
  629 DROP TABLE IF EXISTS `movie`;
  630 CREATE TABLE IF NOT EXISTS `movie` (
  631   `id` int(11) UNSIGNED NOT NULL,
  632   `original_name` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  633   `summary` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  634   `year` int(11) UNSIGNED DEFAULT NULL,
  635   `prefix` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  636   PRIMARY KEY (`id`)
  637 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  638 
  639 -- --------------------------------------------------------
  640 
  641 --
  642 -- Table structure for table `now_playing`
  643 --
  644 
  645 DROP TABLE IF EXISTS `now_playing`;
  646 CREATE TABLE IF NOT EXISTS `now_playing` (
  647   `id` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  648   `object_id` int(11) UNSIGNED NOT NULL,
  649   `object_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  650   `user` int(11) NOT NULL,
  651   `expire` int(11) UNSIGNED NOT NULL DEFAULT 0,
  652   `insertion` int(11) DEFAULT NULL,
  653   PRIMARY KEY (`id`),
  654   KEY `expire` (`expire`)
  655 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  656 
  657 -- --------------------------------------------------------
  658 
  659 --
  660 -- Table structure for table `object_count`
  661 --
  662 
  663 DROP TABLE IF EXISTS `object_count`;
  664 CREATE TABLE IF NOT EXISTS `object_count` (
  665   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  666   `object_type` enum('album','artist','song','playlist','genre','catalog','live_stream','video','podcast_episode') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  667   `object_id` int(11) UNSIGNED NOT NULL DEFAULT 0,
  668   `date` int(11) UNSIGNED NOT NULL DEFAULT 0,
  669   `user` int(11) NOT NULL,
  670   `agent` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  671   `geo_latitude` decimal(10,6) DEFAULT NULL,
  672   `geo_longitude` decimal(10,6) DEFAULT NULL,
  673   `geo_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  674   `count_type` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  675   PRIMARY KEY (`id`),
  676   KEY `object_type` (`object_type`),
  677   KEY `object_id` (`object_id`),
  678   KEY `userid` (`user`),
  679   KEY `date` (`date`)
  680 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  681 
  682 -- --------------------------------------------------------
  683 
  684 --
  685 -- Table structure for table `personal_video`
  686 --
  687 
  688 DROP TABLE IF EXISTS `personal_video`;
  689 CREATE TABLE IF NOT EXISTS `personal_video` (
  690   `id` int(11) UNSIGNED NOT NULL,
  691   `location` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  692   `summary` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  693   PRIMARY KEY (`id`)
  694 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  695 
  696 -- --------------------------------------------------------
  697 
  698 --
  699 -- Table structure for table `player_control`
  700 --
  701 
  702 DROP TABLE IF EXISTS `player_control`;
  703 CREATE TABLE IF NOT EXISTS `player_control` (
  704   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  705   `user` int(11) UNSIGNED NOT NULL,
  706   `cmd` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  707   `value` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  708   `object_type` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  709   `object_id` int(11) UNSIGNED NOT NULL,
  710   `send_date` int(11) UNSIGNED NOT NULL DEFAULT 0,
  711   PRIMARY KEY (`id`)
  712 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  713 
  714 -- --------------------------------------------------------
  715 
  716 --
  717 -- Table structure for table `playlist`
  718 --
  719 
  720 DROP TABLE IF EXISTS `playlist`;
  721 CREATE TABLE IF NOT EXISTS `playlist` (
  722   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  723   `name` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  724   `user` int(11) DEFAULT NULL,
  725   `type` enum('private','public') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  726   `date` int(11) UNSIGNED NOT NULL,
  727   `last_update` int(11) UNSIGNED NOT NULL DEFAULT 0,
  728   `last_duration` int(11) UNSIGNED NOT NULL DEFAULT 0,
  729   `username` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  730   PRIMARY KEY (`id`),
  731   KEY `name` (`name`),
  732   KEY `type` (`type`)
  733 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  734 
  735 -- --------------------------------------------------------
  736 
  737 --
  738 -- Table structure for table `playlist_data`
  739 --
  740 
  741 DROP TABLE IF EXISTS `playlist_data`;
  742 CREATE TABLE IF NOT EXISTS `playlist_data` (
  743   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  744   `playlist` int(11) UNSIGNED NOT NULL DEFAULT 0,
  745   `object_id` int(11) UNSIGNED DEFAULT NULL,
  746   `object_type` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  747   `track` int(11) UNSIGNED NOT NULL DEFAULT 0,
  748   PRIMARY KEY (`id`),
  749   KEY `playlist` (`playlist`)
  750 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  751 
  752 -- --------------------------------------------------------
  753 
  754 --
  755 -- Table structure for table `podcast`
  756 --
  757 
  758 DROP TABLE IF EXISTS `podcast`;
  759 CREATE TABLE IF NOT EXISTS `podcast` (
  760   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  761   `feed` varchar(4096) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  762   `catalog` int(11) NOT NULL,
  763   `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  764   `website` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  765   `description` varchar(4096) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  766   `language` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  767   `copyright` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  768   `generator` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  769   `lastbuilddate` int(11) UNSIGNED NOT NULL DEFAULT 0,
  770   `lastsync` int(11) UNSIGNED NOT NULL DEFAULT 0,
  771   `total_count` int(11) UNSIGNED NOT NULL DEFAULT 0,
  772   `episodes` int(11) UNSIGNED NOT NULL DEFAULT 0,
  773   PRIMARY KEY (`id`)
  774 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  775 
  776 -- --------------------------------------------------------
  777 
  778 --
  779 -- Table structure for table `podcast_episode`
  780 --
  781 
  782 DROP TABLE IF EXISTS `podcast_episode`;
  783 CREATE TABLE IF NOT EXISTS `podcast_episode` (
  784   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  785   `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  786   `guid` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  787   `podcast` int(11) NOT NULL,
  788   `state` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  789   `file` varchar(4096) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  790   `source` varchar(4096) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  791   `size` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
  792   `time` int(11) UNSIGNED NOT NULL DEFAULT 0,
  793   `website` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  794   `description` varchar(4096) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  795   `author` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  796   `category` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  797   `played` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
  798   `pubdate` int(11) UNSIGNED NOT NULL,
  799   `addition_time` int(11) UNSIGNED NOT NULL,
  800   `total_count` int(11) UNSIGNED NOT NULL DEFAULT 0,
  801   `total_skip` int(11) UNSIGNED NOT NULL DEFAULT 0,
  802   `catalog` int(11) UNSIGNED NOT NULL DEFAULT 0,
  803   PRIMARY KEY (`id`)
  804 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  805 
  806 -- --------------------------------------------------------
  807 
  808 --
  809 -- Table structure for table `preference`
  810 --
  811 
  812 DROP TABLE IF EXISTS `preference`;
  813 CREATE TABLE IF NOT EXISTS `preference` (
  814   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  815   `name` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  816   `value` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  817   `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  818   `level` int(11) UNSIGNED NOT NULL DEFAULT 100,
  819   `type` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  820   `catagory` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  821   `subcatagory` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  822   PRIMARY KEY (`id`),
  823   KEY `catagory` (`catagory`),
  824   KEY `name` (`name`)
  825 ) ENGINE=InnoDB AUTO_INCREMENT=164 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  826 
  827 --
  828 -- Dumping data for table `preference`
  829 --
  830 
  831 INSERT INTO `preference` (`id`, `name`, `value`, `description`, `level`, `type`, `catagory`, `subcatagory`) VALUES
  832 (1, 'download', '1', 'Allow Downloads', 100, 'boolean', 'options', 'feature'),
  833 (4, 'popular_threshold', '10', 'Popular Threshold', 25, 'integer', 'interface', 'query'),
  834 (19, 'transcode_bitrate', '128', 'Transcode Bitrate', 25, 'string', 'streaming', 'transcoding'),
  835 (22, 'site_title', 'Ampache :: For the Love of Music', 'Website Title', 100, 'string', 'interface', 'custom'),
  836 (23, 'lock_songs', '0', 'Lock Songs', 100, 'boolean', 'system', NULL),
  837 (24, 'force_http_play', '0', 'Force HTTP playback regardless of port', 100, 'boolean', 'system', NULL),
  838 (29, 'play_type', 'web_player', 'Playback Type', 25, 'special', 'streaming', NULL),
  839 (31, 'lang', 'en_US', 'Language', 100, 'special', 'interface', NULL),
  840 (32, 'playlist_type', 'm3u', 'Playlist Type', 100, 'special', 'playlist', NULL),
  841 (33, 'theme_name', 'reborn', 'Theme', 0, 'special', 'interface', 'theme'),
  842 (40, 'localplay_level', '0', 'Localplay Access', 100, 'special', 'options', 'localplay'),
  843 (41, 'localplay_controller', '0', 'Localplay Type', 100, 'special', 'options', 'localplay'),
  844 (44, 'allow_stream_playback', '1', 'Allow Streaming', 100, 'boolean', 'options', 'feature'),
  845 (45, 'allow_democratic_playback', '0', 'Allow Democratic Play', 100, 'boolean', 'options', 'feature'),
  846 (46, 'allow_localplay_playback', '0', 'Allow Localplay Play', 100, 'boolean', 'options', 'localplay'),
  847 (47, 'stats_threshold', '7', 'Statistics Day Threshold', 75, 'integer', 'interface', 'query'),
  848 (51, 'offset_limit', '50', 'Offset Limit', 5, 'integer', 'interface', 'query'),
  849 (52, 'rate_limit', '8192', 'Rate Limit', 100, 'integer', 'streaming', 'transcoding'),
  850 (53, 'playlist_method', 'default', 'Playlist Method', 5, 'string', 'playlist', NULL),
  851 (55, 'transcode', 'default', 'Allow Transcoding', 25, 'string', 'streaming', 'transcoding'),
  852 (69, 'show_lyrics', '0', 'Show lyrics', 0, 'boolean', 'interface', 'player'),
  853 (70, 'mpd_active', '0', 'MPD Active Instance', 25, 'integer', 'internal', 'mpd'),
  854 (71, 'httpq_active', '0', 'httpQ Active Instance', 25, 'integer', 'internal', 'httpq'),
  855 (77, 'lastfm_grant_link', '', 'Last.FM Grant URL', 25, 'string', 'internal', 'lastfm'),
  856 (78, 'lastfm_challenge', '', 'Last.FM Submit Challenge', 25, 'string', 'internal', 'lastfm'),
  857 (82, 'now_playing_per_user', '1', 'Now Playing filtered per user', 50, 'boolean', 'interface', 'home'),
  858 (83, 'album_sort', '0', 'Album - Default sort', 25, 'string', 'interface', 'library'),
  859 (84, 'show_played_times', '0', 'Show # played', 25, 'string', 'interface', 'browse'),
  860 (85, 'song_page_title', '1', 'Show current song in Web Player page title', 25, 'boolean', 'interface', 'player'),
  861 (86, 'subsonic_backend', '1', 'Use Subsonic backend', 100, 'boolean', 'system', 'backend'),
  862 (88, 'webplayer_flash', '1', 'Authorize Flash Web Player', 25, 'boolean', 'streaming', 'player'),
  863 (89, 'webplayer_html5', '1', 'Authorize HTML5 Web Player', 25, 'boolean', 'streaming', 'player'),
  864 (90, 'allow_personal_info_now', '1', 'Share Now Playing information', 25, 'boolean', 'interface', 'privacy'),
  865 (91, 'allow_personal_info_recent', '1', 'Share Recently Played information', 25, 'boolean', 'interface', 'privacy'),
  866 (92, 'allow_personal_info_time', '1', 'Share Recently Played information - Allow access to streaming date/time', 25, 'boolean', 'interface', 'privacy'),
  867 (93, 'allow_personal_info_agent', '1', 'Share Recently Played information - Allow access to streaming agent', 25, 'boolean', 'interface', 'privacy'),
  868 (94, 'ui_fixed', '0', 'Fix header position on compatible themes', 25, 'boolean', 'interface', 'theme'),
  869 (95, 'autoupdate', '1', 'Check for Ampache updates automatically', 25, 'boolean', 'system', 'update'),
  870 (96, 'autoupdate_lastcheck', '', 'AutoUpdate last check time', 25, 'string', 'internal', 'update'),
  871 (97, 'autoupdate_lastversion', '', 'AutoUpdate last version from last check', 25, 'string', 'internal', 'update'),
  872 (98, 'autoupdate_lastversion_new', '', 'AutoUpdate last version from last check is newer', 25, 'boolean', 'internal', 'update'),
  873 (99, 'webplayer_confirmclose', '0', 'Confirmation when closing current playing window', 25, 'boolean', 'interface', 'player'),
  874 (100, 'webplayer_pausetabs', '1', 'Auto-pause between tabs', 25, 'boolean', 'interface', 'player'),
  875 (101, 'stream_beautiful_url', '0', 'Enable URL Rewriting', 100, 'boolean', 'streaming', NULL),
  876 (102, 'share', '0', 'Allow Share', 100, 'boolean', 'options', 'feature'),
  877 (103, 'share_expire', '7', 'Share links default expiration days (0=never)', 100, 'integer', 'system', 'share'),
  878 (104, 'slideshow_time', '0', 'Artist slideshow inactivity time', 25, 'integer', 'interface', 'player'),
  879 (105, 'broadcast_by_default', '0', 'Broadcast web player by default', 25, 'boolean', 'streaming', 'player'),
  880 (108, 'album_group', '1', 'Album - Group multiple disks', 25, 'boolean', 'interface', 'library'),
  881 (109, 'topmenu', '0', 'Top menu', 25, 'boolean', 'interface', 'theme'),
  882 (110, 'demo_clear_sessions', '0', 'Democratic - Clear votes for expired user sessions', 25, 'boolean', 'playlist', NULL),
  883 (111, 'show_donate', '1', 'Show donate button in footer', 25, 'boolean', 'interface', NULL),
  884 (112, 'upload_catalog', '-1', 'Destination catalog', 75, 'integer', 'system', 'upload'),
  885 (113, 'allow_upload', '0', 'Allow user uploads', 75, 'boolean', 'system', 'upload'),
  886 (114, 'upload_subdir', '1', 'Create a subdirectory per user', 75, 'boolean', 'system', 'upload'),
  887 (115, 'upload_user_artist', '0', 'Consider the user sender as the track\'s artist', 75, 'boolean', 'system', 'upload'),
  888 (116, 'upload_script', '', 'Post-upload script (current directory = upload target directory)', 75, 'string', 'system', 'upload'),
  889 (117, 'upload_allow_edit', '1', 'Allow users to edit uploaded songs', 75, 'boolean', 'system', 'upload'),
  890 (118, 'daap_backend', '0', 'Use DAAP backend', 100, 'boolean', 'system', 'backend'),
  891 (119, 'daap_pass', '', 'DAAP backend password', 100, 'string', 'system', 'backend'),
  892 (120, 'upnp_backend', '0', 'Use UPnP backend', 100, 'boolean', 'system', 'backend'),
  893 (121, 'allow_video', '0', 'Allow Video Features', 75, 'integer', 'options', 'feature'),
  894 (122, 'album_release_type', '1', 'Album - Group per release type', 25, 'boolean', 'interface', 'library'),
  895 (123, 'ajax_load', '1', 'Ajax page load', 25, 'boolean', 'interface', NULL),
  896 (124, 'direct_play_limit', '0', 'Limit direct play to maximum media count', 25, 'integer', 'interface', 'player'),
  897 (125, 'home_moment_albums', '1', 'Show Albums of the Moment', 25, 'integer', 'interface', 'home'),
  898 (126, 'home_moment_videos', '0', 'Show Videos of the Moment', 25, 'integer', 'interface', 'home'),
  899 (127, 'home_recently_played', '1', 'Show Recently Played', 25, 'integer', 'interface', 'home'),
  900 (128, 'home_now_playing', '1', 'Show Now Playing', 25, 'integer', 'interface', 'home'),
  901 (129, 'custom_logo', '', 'Custom URL - Logo', 25, 'string', 'interface', 'custom'),
  902 (130, 'album_release_type_sort', 'album,ep,live,single', 'Album - Group per release type sort', 25, 'string', 'interface', 'library'),
  903 (131, 'browser_notify', '1', 'Web Player browser notifications', 25, 'integer', 'interface', 'notification'),
  904 (132, 'browser_notify_timeout', '10', 'Web Player browser notifications timeout (seconds)', 25, 'integer', 'interface', 'notification'),
  905 (133, 'geolocation', '0', 'Allow Geolocation', 25, 'integer', 'options', 'feature'),
  906 (134, 'webplayer_aurora', '1', 'Authorize JavaScript decoder (Aurora.js) in Web Player', 25, 'boolean', 'streaming', 'player'),
  907 (135, 'upload_allow_remove', '1', 'Allow users to remove uploaded songs', 75, 'boolean', 'system', 'upload'),
  908 (136, 'custom_login_logo', '', 'Custom URL - Login page logo', 75, 'string', 'interface', 'custom'),
  909 (137, 'custom_favicon', '', 'Custom URL - Favicon', 75, 'string', 'interface', 'custom'),
  910 (138, 'custom_text_footer', '', 'Custom text footer', 75, 'string', 'interface', 'custom'),
  911 (139, 'webdav_backend', '0', 'Use WebDAV backend', 100, 'boolean', 'system', 'backend'),
  912 (140, 'notify_email', '0', 'Allow E-mail notifications', 25, 'boolean', 'options', NULL),
  913 (141, 'theme_color', 'dark', 'Theme color', 0, 'special', 'interface', 'theme'),
  914 (142, 'disabled_custom_metadata_fields', '', 'Custom metadata - Disable these fields', 100, 'string', 'system', 'metadata'),
  915 (143, 'disabled_custom_metadata_fields_input', '', 'Custom metadata - Define field list', 100, 'string', 'system', 'metadata'),
  916 (144, 'podcast_keep', '0', '# latest episodes to keep', 100, 'integer', 'system', 'podcast'),
  917 (145, 'podcast_new_download', '0', '# episodes to download when new episodes are available', 100, 'integer', 'system', 'podcast'),
  918 (146, 'libitem_contextmenu', '1', 'Library item context menu', 0, 'boolean', 'interface', 'library'),
  919 (147, 'upload_catalog_pattern', '0', 'Rename uploaded file according to catalog pattern', 100, 'boolean', 'system', 'upload'),
  920 (148, 'catalog_check_duplicate', '0', 'Check library item at import time and don\'t import duplicates', 100, 'boolean', 'system', 'catalog'),
  921 (149, 'browse_filter', '0', 'Show filter box on browse', 25, 'boolean', 'interface', 'browse'),
  922 (150, 'sidebar_light', '0', 'Light sidebar by default', 25, 'boolean', 'interface', 'theme'),
  923 (151, 'custom_blankalbum', '', 'Custom blank album default image', 75, 'string', 'interface', 'custom'),
  924 (152, 'custom_blankmovie', '', 'Custom blank video default image', 75, 'string', 'interface', 'custom'),
  925 (153, 'libitem_browse_alpha', '', 'Alphabet browsing by default for following library items (album,artist,...)', 75, 'string', 'interface', 'browse'),
  926 (154, 'show_skipped_times', '0', 'Show # skipped', 25, 'boolean', 'interface', 'browse'),
  927 (155, 'custom_datetime', '', 'Custom datetime', 25, 'string', 'interface', 'custom'),
  928 (156, 'cron_cache', '0', 'Cache computed SQL data (eg. media hits stats) using a cron', 25, 'boolean', 'system', 'catalog'),
  929 (157, 'unique_playlist', '0', 'Only add unique items to playlists', 25, 'boolean', 'playlist', NULL),
  930 (158, 'of_the_moment', '6', 'Set the amount of items Album/Video of the Moment will display', 25, 'integer', 'interface', 'home'),
  931 (159, 'custom_login_background', '', 'Custom URL - Login page background', 75, 'string', 'interface', 'custom'),
  932 (160, 'show_license', '1', 'Show Licence', 25, 'boolean', 'interface', 'browse'),
  933 (161, 'use_original_year', '0', 'Browse by Original Year for albums (falls back to Year)', 25, 'boolean', 'interface', 'browse'),
  934 (162, 'hide_single_artist', '0', 'Hide the Song Artist column for Albums with one Artist', 25, 'boolean', 'interface', 'browse'),
  935 (163, 'hide_genres', '0', 'Hide the Genre column in browse table rows', 25, 'boolean', 'interface', 'browse');
  936 
  937 -- --------------------------------------------------------
  938 
  939 --
  940 -- Table structure for table `rating`
  941 --
  942 
  943 DROP TABLE IF EXISTS `rating`;
  944 CREATE TABLE IF NOT EXISTS `rating` (
  945   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  946   `user` int(11) NOT NULL,
  947   `object_type` enum('artist','album','song','stream','video','playlist','tvshow','tvshow_season','podcast','podcast_episode') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  948   `object_id` int(11) UNSIGNED NOT NULL DEFAULT 0,
  949   `rating` tinyint(4) NOT NULL,
  950   PRIMARY KEY (`id`),
  951   UNIQUE KEY `unique_rating` (`user`,`object_type`,`object_id`),
  952   KEY `object_id` (`object_id`)
  953 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  954 
  955 -- --------------------------------------------------------
  956 
  957 --
  958 -- Table structure for table `recommendation`
  959 --
  960 
  961 DROP TABLE IF EXISTS `recommendation`;
  962 CREATE TABLE IF NOT EXISTS `recommendation` (
  963   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  964   `object_type` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  965   `object_id` int(11) UNSIGNED NOT NULL,
  966   `last_update` int(11) UNSIGNED NOT NULL DEFAULT 0,
  967   PRIMARY KEY (`id`)
  968 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  969 
  970 -- --------------------------------------------------------
  971 
  972 --
  973 -- Table structure for table `recommendation_item`
  974 --
  975 
  976 DROP TABLE IF EXISTS `recommendation_item`;
  977 CREATE TABLE IF NOT EXISTS `recommendation_item` (
  978   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  979   `recommendation` int(11) UNSIGNED NOT NULL,
  980   `recommendation_id` int(11) UNSIGNED DEFAULT NULL,
  981   `name` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  982   `rel` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  983   `mbid` varchar(1369) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  984   PRIMARY KEY (`id`)
  985 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  986 
  987 -- --------------------------------------------------------
  988 
  989 --
  990 -- Table structure for table `search`
  991 --
  992 
  993 DROP TABLE IF EXISTS `search`;
  994 CREATE TABLE IF NOT EXISTS `search` (
  995   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  996   `user` int(11) NOT NULL,
  997   `type` enum('private','public') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  998   `rules` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
  999   `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1000   `logic_operator` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1001   `random` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
 1002   `limit` int(11) UNSIGNED NOT NULL DEFAULT 0,
 1003   `last_count` int(11) DEFAULT NULL,
 1004   `last_duration` int(11) DEFAULT NULL,
 1005   `username` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1006   PRIMARY KEY (`id`)
 1007 ) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1008 
 1009 --
 1010 -- Dumping data for table `search`
 1011 --
 1012 
 1013 INSERT INTO `search` (`id`, `user`, `type`, `rules`, `name`, `logic_operator`, `random`, `limit`, `last_count`, `last_duration`, `username`) VALUES
 1014 (5, -1, 'public', '[[\"artistrating\",\"equal\",\"5\",null]]', 'Artist 5*', 'AND', 0, 0, NULL, NULL, 'System'),
 1015 (6, -1, 'public', '[[\"artistrating\",\"equal\",\"4\",null]]', 'Artist 4*', 'AND', 0, 0, NULL, NULL, 'System'),
 1016 (7, -1, 'public', '[[\"artistrating\",\"equal\",\"3\",null]]', 'Artist 3*', 'AND', 0, 0, NULL, NULL, 'System'),
 1017 (8, -1, 'public', '[[\"artistrating\",\"equal\",\"2\",null]]', 'Artist 2*', 'AND', 0, 0, NULL, NULL, 'System'),
 1018 (9, -1, 'public', '[[\"artistrating\",\"equal\",\"1\",null]]', 'Artist 1*', 'AND', 0, 0, NULL, NULL, 'System'),
 1019 (10, -1, 'public', '[[\"albumrating\",\"equal\",\"5\",null]]', 'Album 5*', 'AND', 0, 0, NULL, NULL, 'System'),
 1020 (11, -1, 'public', '[[\"albumrating\",\"equal\",\"4\",null]]', 'Album 4*', 'AND', 0, 0, NULL, NULL, 'System'),
 1021 (12, -1, 'public', '[[\"albumrating\",\"equal\",\"3\",null]]', 'Album 3*', 'AND', 0, 0, NULL, NULL, 'System'),
 1022 (13, -1, 'public', '[[\"albumrating\",\"equal\",\"2\",null]]', 'Album 2*', 'AND', 0, 0, NULL, NULL, 'System'),
 1023 (14, -1, 'public', '[[\"albumrating\",\"equal\",\"1\",null]]', 'Album 1*', 'AND', 0, 0, NULL, NULL, 'System'),
 1024 (15, -1, 'public', '[[\"myrating\",\"equal\",\"5\",null]]', 'Song 5*', 'AND', 0, 0, NULL, NULL, 'System'),
 1025 (16, -1, 'public', '[[\"myrating\",\"equal\",\"4\",null]]', 'Song 4*', 'AND', 0, 0, NULL, NULL, 'System'),
 1026 (17, -1, 'public', '[[\"myrating\",\"equal\",\"3\",null]]', 'Song 3*', 'AND', 0, 0, NULL, NULL, 'System'),
 1027 (18, -1, 'public', '[[\"myrating\",\"equal\",\"2\",null]]', 'Song 2*', 'AND', 0, 0, NULL, NULL, 'System'),
 1028 (19, -1, 'public', '[[\"myrating\",\"equal\",\"1\",null]]', 'Song 1*', 'AND', 0, 0, NULL, NULL, 'System');
 1029 
 1030 -- --------------------------------------------------------
 1031 
 1032 --
 1033 -- Table structure for table `session`
 1034 --
 1035 
 1036 DROP TABLE IF EXISTS `session`;
 1037 CREATE TABLE IF NOT EXISTS `session` (
 1038   `id` varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL,
 1039   `username` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1040   `expire` int(11) UNSIGNED NOT NULL DEFAULT 0,
 1041   `value` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
 1042   `ip` varbinary(255) DEFAULT NULL,
 1043   `type` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1044   `agent` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1045   `geo_latitude` decimal(10,6) DEFAULT NULL,
 1046   `geo_longitude` decimal(10,6) DEFAULT NULL,
 1047   `geo_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1048   PRIMARY KEY (`id`),
 1049   KEY `expire` (`expire`),
 1050   KEY `type` (`type`)
 1051 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1052 
 1053 -- --------------------------------------------------------
 1054 
 1055 --
 1056 -- Table structure for table `session_remember`
 1057 --
 1058 
 1059 DROP TABLE IF EXISTS `session_remember`;
 1060 CREATE TABLE IF NOT EXISTS `session_remember` (
 1061   `username` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
 1062   `token` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,
 1063   `expire` int(11) DEFAULT NULL,
 1064   PRIMARY KEY (`username`,`token`)
 1065 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1066 
 1067 -- --------------------------------------------------------
 1068 
 1069 --
 1070 -- Table structure for table `session_stream`
 1071 --
 1072 
 1073 DROP TABLE IF EXISTS `session_stream`;
 1074 CREATE TABLE IF NOT EXISTS `session_stream` (
 1075   `id` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
 1076   `user` int(11) UNSIGNED NOT NULL,
 1077   `agent` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1078   `expire` int(11) UNSIGNED NOT NULL,
 1079   `ip` varbinary(255) DEFAULT NULL,
 1080   PRIMARY KEY (`id`)
 1081 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1082 
 1083 -- --------------------------------------------------------
 1084 
 1085 --
 1086 -- Table structure for table `share`
 1087 --
 1088 
 1089 DROP TABLE IF EXISTS `share`;
 1090 CREATE TABLE IF NOT EXISTS `share` (
 1091   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
 1092   `user` int(11) UNSIGNED NOT NULL,
 1093   `object_type` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1094   `object_id` int(11) UNSIGNED NOT NULL,
 1095   `allow_stream` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
 1096   `allow_download` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
 1097   `expire_days` int(4) UNSIGNED NOT NULL DEFAULT 0,
 1098   `max_counter` int(4) UNSIGNED NOT NULL DEFAULT 0,
 1099   `secret` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1100   `counter` int(4) UNSIGNED NOT NULL DEFAULT 0,
 1101   `creation_date` int(11) UNSIGNED NOT NULL DEFAULT 0,
 1102   `lastvisit_date` int(11) UNSIGNED NOT NULL DEFAULT 0,
 1103   `public_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1104   `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1105   PRIMARY KEY (`id`)
 1106 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1107 
 1108 -- --------------------------------------------------------
 1109 
 1110 --
 1111 -- Table structure for table `song`
 1112 --
 1113 
 1114 DROP TABLE IF EXISTS `song`;
 1115 CREATE TABLE IF NOT EXISTS `song` (
 1116   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
 1117   `file` varchar(4096) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1118   `catalog` int(11) UNSIGNED NOT NULL DEFAULT 0,
 1119   `album` int(11) UNSIGNED NOT NULL DEFAULT 0,
 1120   `year` mediumint(4) UNSIGNED NOT NULL DEFAULT 0,
 1121   `artist` int(11) UNSIGNED NOT NULL DEFAULT 0,
 1122   `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1123   `bitrate` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
 1124   `rate` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
 1125   `mode` enum('abr','vbr','cbr') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1126   `size` int(11) UNSIGNED NOT NULL DEFAULT 0,
 1127   `time` smallint(5) UNSIGNED NOT NULL DEFAULT 0,
 1128   `track` smallint(6) DEFAULT NULL,
 1129   `mbid` varchar(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1130   `played` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
 1131   `enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
 1132   `update_time` int(11) UNSIGNED DEFAULT 0,
 1133   `addition_time` int(11) UNSIGNED DEFAULT 0,
 1134   `user_upload` int(11) DEFAULT NULL,
 1135   `license` int(11) DEFAULT NULL,
 1136   `composer` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1137   `channels` mediumint(9) DEFAULT NULL,
 1138   `total_count` int(11) UNSIGNED NOT NULL DEFAULT 0,
 1139   `total_skip` int(11) UNSIGNED NOT NULL DEFAULT 0,
 1140   PRIMARY KEY (`id`),
 1141   KEY `album` (`album`),
 1142   KEY `artist` (`artist`),
 1143   KEY `file` (`file`(333)),
 1144   KEY `update_time` (`update_time`),
 1145   KEY `addition_time` (`addition_time`),
 1146   KEY `catalog` (`catalog`),
 1147   KEY `played` (`played`),
 1148   KEY `enabled` (`enabled`)
 1149 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1150 
 1151 -- --------------------------------------------------------
 1152 
 1153 --
 1154 -- Table structure for table `song_data`
 1155 --
 1156 
 1157 DROP TABLE IF EXISTS `song_data`;
 1158 CREATE TABLE IF NOT EXISTS `song_data` (
 1159   `song_id` int(11) UNSIGNED NOT NULL,
 1160   `comment` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1161   `lyrics` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1162   `label` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1163   `language` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1164   `waveform` mediumblob DEFAULT NULL,
 1165   `replaygain_track_gain` decimal(10,6) DEFAULT NULL,
 1166   `replaygain_track_peak` decimal(10,6) DEFAULT NULL,
 1167   `replaygain_album_gain` decimal(10,6) DEFAULT NULL,
 1168   `replaygain_album_peak` decimal(10,6) DEFAULT NULL,
 1169   `r128_track_gain` smallint(5) DEFAULT NULL,
 1170   `r128_album_gain` smallint(5) DEFAULT NULL,
 1171   UNIQUE KEY `song_id` (`song_id`)
 1172 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1173 
 1174 -- --------------------------------------------------------
 1175 
 1176 --
 1177 -- Table structure for table `song_preview`
 1178 --
 1179 
 1180 DROP TABLE IF EXISTS `song_preview`;
 1181 CREATE TABLE IF NOT EXISTS `song_preview` (
 1182   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
 1183   `session` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1184   `artist` int(11) DEFAULT NULL,
 1185   `artist_mbid` varchar(1369) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1186   `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1187   `album_mbid` varchar(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1188   `mbid` varchar(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1189   `disk` int(11) DEFAULT NULL,
 1190   `track` int(11) DEFAULT NULL,
 1191   `file` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1192   PRIMARY KEY (`id`)
 1193 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1194 
 1195 -- --------------------------------------------------------
 1196 
 1197 --
 1198 -- Table structure for table `stream_playlist`
 1199 --
 1200 
 1201 DROP TABLE IF EXISTS `stream_playlist`;
 1202 CREATE TABLE IF NOT EXISTS `stream_playlist` (
 1203   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
 1204   `sid` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1205   `url` text COLLATE utf8mb4_unicode_ci NOT NULL,
 1206   `info_url` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1207   `image_url` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1208   `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1209   `author` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1210   `album` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1211   `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1212   `time` smallint(5) DEFAULT NULL,
 1213   `codec` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1214   `track_num` smallint(5) DEFAULT 0,
 1215   PRIMARY KEY (`id`),
 1216   KEY `sid` (`sid`)
 1217 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1218 
 1219 -- --------------------------------------------------------
 1220 
 1221 --
 1222 -- Table structure for table `tag`
 1223 --
 1224 
 1225 DROP TABLE IF EXISTS `tag`;
 1226 CREATE TABLE IF NOT EXISTS `tag` (
 1227   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
 1228   `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1229   `is_hidden` tinyint(1) NOT NULL DEFAULT 0,
 1230   UNIQUE KEY `name` (`name`),
 1231   KEY `map_id` (`id`)
 1232 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1233 
 1234 -- --------------------------------------------------------
 1235 
 1236 --
 1237 -- Table structure for table `tag_map`
 1238 --
 1239 
 1240 DROP TABLE IF EXISTS `tag_map`;
 1241 CREATE TABLE IF NOT EXISTS `tag_map` (
 1242   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
 1243   `tag_id` int(11) UNSIGNED NOT NULL,
 1244   `object_id` int(11) UNSIGNED NOT NULL,
 1245   `object_type` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1246   `user` int(11) NOT NULL,
 1247   PRIMARY KEY (`id`),
 1248   UNIQUE KEY `unique_tag_map` (`object_id`,`object_type`,`user`,`tag_id`)
 1249 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1250 
 1251 -- --------------------------------------------------------
 1252 
 1253 --
 1254 -- Table structure for table `tag_merge`
 1255 --
 1256 
 1257 DROP TABLE IF EXISTS `tag_merge`;
 1258 CREATE TABLE IF NOT EXISTS `tag_merge` (
 1259   `tag_id` int(11) NOT NULL,
 1260   `merged_to` int(11) NOT NULL,
 1261   PRIMARY KEY (`tag_id`,`merged_to`),
 1262   KEY `merged_to` (`merged_to`)
 1263 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1264 
 1265 -- --------------------------------------------------------
 1266 
 1267 --
 1268 -- Table structure for table `tmp_browse`
 1269 --
 1270 
 1271 DROP TABLE IF EXISTS `tmp_browse`;
 1272 CREATE TABLE IF NOT EXISTS `tmp_browse` (
 1273   `id` int(13) NOT NULL AUTO_INCREMENT,
 1274   `sid` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,
 1275   `data` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
 1276   `object_data` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1277   PRIMARY KEY (`sid`,`id`)
 1278 ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1279 
 1280 -- --------------------------------------------------------
 1281 
 1282 --
 1283 -- Table structure for table `tmp_playlist`
 1284 --
 1285 
 1286 DROP TABLE IF EXISTS `tmp_playlist`;
 1287 CREATE TABLE IF NOT EXISTS `tmp_playlist` (
 1288   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
 1289   `session` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1290   `type` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1291   `object_type` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1292   PRIMARY KEY (`id`),
 1293   KEY `session` (`session`),
 1294   KEY `type` (`type`)
 1295 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1296 
 1297 -- --------------------------------------------------------
 1298 
 1299 --
 1300 -- Table structure for table `tmp_playlist_data`
 1301 --
 1302 
 1303 DROP TABLE IF EXISTS `tmp_playlist_data`;
 1304 CREATE TABLE IF NOT EXISTS `tmp_playlist_data` (
 1305   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
 1306   `tmp_playlist` int(11) UNSIGNED NOT NULL,
 1307   `object_type` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1308   `object_id` int(11) UNSIGNED NOT NULL,
 1309   `track` int(11) UNSIGNED DEFAULT NULL,
 1310   PRIMARY KEY (`id`),
 1311   KEY `tmp_playlist` (`tmp_playlist`)
 1312 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1313 
 1314 -- --------------------------------------------------------
 1315 
 1316 --
 1317 -- Table structure for table `tvshow`
 1318 --
 1319 
 1320 DROP TABLE IF EXISTS `tvshow`;
 1321 CREATE TABLE IF NOT EXISTS `tvshow` (
 1322   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
 1323   `name` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1324   `summary` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1325   `year` int(11) UNSIGNED DEFAULT NULL,
 1326   `prefix` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1327   PRIMARY KEY (`id`)
 1328 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1329 
 1330 -- --------------------------------------------------------
 1331 
 1332 --
 1333 -- Table structure for table `tvshow_episode`
 1334 --
 1335 
 1336 DROP TABLE IF EXISTS `tvshow_episode`;
 1337 CREATE TABLE IF NOT EXISTS `tvshow_episode` (
 1338   `id` int(11) UNSIGNED NOT NULL,
 1339   `original_name` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1340   `season` int(11) UNSIGNED NOT NULL,
 1341   `episode_number` int(11) UNSIGNED NOT NULL,
 1342   `summary` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1343   PRIMARY KEY (`id`)
 1344 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1345 
 1346 -- --------------------------------------------------------
 1347 
 1348 --
 1349 -- Table structure for table `tvshow_season`
 1350 --
 1351 
 1352 DROP TABLE IF EXISTS `tvshow_season`;
 1353 CREATE TABLE IF NOT EXISTS `tvshow_season` (
 1354   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
 1355   `season_number` int(11) UNSIGNED NOT NULL,
 1356   `tvshow` int(11) UNSIGNED NOT NULL,
 1357   PRIMARY KEY (`id`)
 1358 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1359 
 1360 -- --------------------------------------------------------
 1361 
 1362 --
 1363 -- Table structure for table `update_info`
 1364 --
 1365 
 1366 DROP TABLE IF EXISTS `update_info`;
 1367 CREATE TABLE IF NOT EXISTS `update_info` (
 1368   `key` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1369   `value` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1370   UNIQUE KEY `key` (`key`)
 1371 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1372 
 1373 --
 1374 -- Dumping data for table `update_info`
 1375 --
 1376 
 1377 INSERT INTO `update_info` (`key`, `value`) VALUES
 1378 ('db_version', '500015'),
 1379 ('Plugin_Last.FM', '000005');
 1380 
 1381 -- --------------------------------------------------------
 1382 
 1383 --
 1384 -- Table structure for table `user`
 1385 --
 1386 
 1387 DROP TABLE IF EXISTS `user`;
 1388 CREATE TABLE IF NOT EXISTS `user` (
 1389   `id` int(11) NOT NULL AUTO_INCREMENT,
 1390   `username` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1391   `fullname` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1392   `email` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1393   `website` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1394   `apikey` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1395   `password` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1396   `access` tinyint(4) UNSIGNED NOT NULL,
 1397   `disabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
 1398   `last_seen` int(11) UNSIGNED NOT NULL DEFAULT 0,
 1399   `create_date` int(11) UNSIGNED DEFAULT NULL,
 1400   `validation` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1401   `state` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1402   `city` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1403   `fullname_public` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
 1404   `rsstoken` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1405   PRIMARY KEY (`id`),
 1406   UNIQUE KEY `username` (`username`)
 1407 ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1408 
 1409 -- --------------------------------------------------------
 1410 
 1411 --
 1412 -- Table structure for table `user_activity`
 1413 --
 1414 
 1415 DROP TABLE IF EXISTS `user_activity`;
 1416 CREATE TABLE IF NOT EXISTS `user_activity` (
 1417   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
 1418   `user` int(11) UNSIGNED NOT NULL,
 1419   `action` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1420   `object_id` int(11) UNSIGNED NOT NULL,
 1421   `object_type` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1422   `activity_date` int(11) UNSIGNED NOT NULL,
 1423   `name_track` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1424   `name_artist` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1425   `name_album` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1426   `mbid_track` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1427   `mbid_artist` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1428   `mbid_album` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1429   PRIMARY KEY (`id`)
 1430 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1431 
 1432 -- --------------------------------------------------------
 1433 
 1434 --
 1435 -- Table structure for table `user_catalog`
 1436 --
 1437 
 1438 DROP TABLE IF EXISTS `user_catalog`;
 1439 CREATE TABLE IF NOT EXISTS `user_catalog` (
 1440   `user` int(11) UNSIGNED NOT NULL,
 1441   `catalog` int(11) UNSIGNED NOT NULL,
 1442   `level` smallint(4) UNSIGNED NOT NULL DEFAULT 5,
 1443   KEY `user` (`user`),
 1444   KEY `catalog` (`catalog`)
 1445 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1446 
 1447 -- --------------------------------------------------------
 1448 
 1449 --
 1450 -- Table structure for table `user_data`
 1451 --
 1452 
 1453 DROP TABLE IF EXISTS `user_data`;
 1454 CREATE TABLE IF NOT EXISTS `user_data` (
 1455   `user` int(11) DEFAULT NULL,
 1456   `key` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1457   `value` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1458   UNIQUE KEY `unique_data` (`user`,`key`),
 1459   KEY `user` (`user`),
 1460   KEY `key` (`key`)
 1461 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1462 
 1463 -- --------------------------------------------------------
 1464 
 1465 --
 1466 -- Table structure for table `user_flag`
 1467 --
 1468 
 1469 DROP TABLE IF EXISTS `user_flag`;
 1470 CREATE TABLE IF NOT EXISTS `user_flag` (
 1471   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
 1472   `user` int(11) NOT NULL,
 1473   `object_id` int(11) UNSIGNED NOT NULL,
 1474   `object_type` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1475   `date` int(11) UNSIGNED NOT NULL DEFAULT 0,
 1476   PRIMARY KEY (`id`),
 1477   UNIQUE KEY `unique_userflag` (`user`,`object_type`,`object_id`),
 1478   KEY `object_id` (`object_id`)
 1479 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1480 
 1481 -- --------------------------------------------------------
 1482 
 1483 --
 1484 -- Table structure for table `user_follower`
 1485 --
 1486 
 1487 DROP TABLE IF EXISTS `user_follower`;
 1488 CREATE TABLE IF NOT EXISTS `user_follower` (
 1489   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
 1490   `user` int(11) UNSIGNED NOT NULL,
 1491   `follow_user` int(11) UNSIGNED NOT NULL,
 1492   `follow_date` int(11) UNSIGNED DEFAULT NULL,
 1493   `creation_date` int(11) UNSIGNED DEFAULT NULL,
 1494   PRIMARY KEY (`id`)
 1495 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1496 
 1497 -- --------------------------------------------------------
 1498 
 1499 --
 1500 -- Table structure for table `user_playlist`
 1501 --
 1502 
 1503 DROP TABLE IF EXISTS `user_playlist`;
 1504 CREATE TABLE IF NOT EXISTS `user_playlist` (
 1505   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
 1506   `user` int(11) DEFAULT NULL,
 1507   `object_type` enum('song','live_stream','video','podcast_episode') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1508   `object_id` int(11) UNSIGNED NOT NULL DEFAULT 0,
 1509   `track` smallint(6) DEFAULT NULL,
 1510   `current_track` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
 1511   `current_time` smallint(5) UNSIGNED NOT NULL DEFAULT 0,
 1512   PRIMARY KEY (`id`),
 1513   KEY `user` (`user`)
 1514 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1515 
 1516 -- --------------------------------------------------------
 1517 
 1518 --
 1519 -- Table structure for table `user_preference`
 1520 --
 1521 
 1522 DROP TABLE IF EXISTS `user_preference`;
 1523 CREATE TABLE IF NOT EXISTS `user_preference` (
 1524   `user` int(11) NOT NULL,
 1525   `preference` int(11) UNSIGNED NOT NULL DEFAULT 0,
 1526   `value` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1527   KEY `user` (`user`),
 1528   KEY `preference` (`preference`)
 1529 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1530 
 1531 --
 1532 -- Dumping data for table `user_preference`
 1533 --
 1534 
 1535 INSERT INTO `user_preference` (`user`, `preference`, `value`) VALUES
 1536 (-1, 1, '1'),
 1537 (-1, 4, '10'),
 1538 (-1, 19, '32'),
 1539 (-1, 22, 'Ampache :: For the Love of Music'),
 1540 (-1, 23, '0'),
 1541 (-1, 24, '0'),
 1542 (-1, 25, '80'),
 1543 (-1, 41, 'mpd'),
 1544 (-1, 29, 'web_player'),
 1545 (-1, 31, 'en_US'),
 1546 (-1, 32, 'm3u'),
 1547 (-1, 33, 'reborn'),
 1548 (-1, 34, '27'),
 1549 (-1, 35, '27'),
 1550 (-1, 36, '27'),
 1551 (-1, 51, '50'),
 1552 (-1, 40, '100'),
 1553 (-1, 44, '1'),
 1554 (-1, 45, '1'),
 1555 (-1, 46, '1'),
 1556 (-1, 47, '7'),
 1557 (-1, 49, '1'),
 1558 (-1, 52, '8192'),
 1559 (-1, 53, 'default'),
 1560 (-1, 55, 'default'),
 1561 (-1, 57, ''),
 1562 (-1, 69, '0'),
 1563 (-1, 70, '0'),
 1564 (-1, 71, '0'),
 1565 (-1, 72, '0'),
 1566 (-1, 77, ''),
 1567 (-1, 78, ''),
 1568 (-1, 114, '1'),
 1569 (-1, 113, '0'),
 1570 (-1, 112, '-1'),
 1571 (-1, 111, '1'),
 1572 (-1, 110, '0'),
 1573 (-1, 109, '0'),
 1574 (-1, 108, '1'),
 1575 (-1, 163, '0'),
 1576 (-1, 162, '0'),
 1577 (-1, 105, '0'),
 1578 (-1, 104, '0'),
 1579 (-1, 103, '7'),
 1580 (-1, 102, '0'),
 1581 (-1, 101, '0'),
 1582 (-1, 100, '1'),
 1583 (-1, 99, '0'),
 1584 (-1, 95, '1'),
 1585 (-1, 94, '0'),
 1586 (-1, 93, '1'),
 1587 (-1, 92, '1'),
 1588 (-1, 91, '1'),
 1589 (-1, 90, '1'),
 1590 (-1, 89, '1'),
 1591 (-1, 88, '1'),
 1592 (-1, 87, '0'),
 1593 (-1, 86, '1'),
 1594 (-1, 85, '1'),
 1595 (-1, 84, '0'),
 1596 (-1, 83, '0'),
 1597 (-1, 79, '50'),
 1598 (-1, 80, '50'),
 1599 (-1, 82, '1'),
 1600 (-1, 81, '1'),
 1601 (-1, 154, '0'),
 1602 (-1, 116, ''),
 1603 (-1, 117, '1'),
 1604 (-1, 118, '0'),
 1605 (-1, 119, ''),
 1606 (-1, 120, '0'),
 1607 (-1, 121, '0'),
 1608 (-1, 122, '1'),
 1609 (-1, 123, '1'),
 1610 (-1, 124, '0'),
 1611 (-1, 125, '1'),
 1612 (-1, 126, '1'),
 1613 (-1, 127, '1'),
 1614 (-1, 128, '1'),
 1615 (-1, 129, ''),
 1616 (-1, 130, 'album,ep,live,single'),
 1617 (-1, 131, '1'),
 1618 (-1, 132, '10'),
 1619 (-1, 133, '0'),
 1620 (-1, 134, '1'),
 1621 (-1, 135, '1'),
 1622 (-1, 136, ''),
 1623 (-1, 137, ''),
 1624 (-1, 138, ''),
 1625 (-1, 139, '0'),
 1626 (-1, 140, '0'),
 1627 (-1, 141, 'dark'),
 1628 (-1, 142, ''),
 1629 (-1, 143, ''),
 1630 (-1, 96, ''),
 1631 (-1, 97, ''),
 1632 (-1, 98, ''),
 1633 (-1, 144, '10'),
 1634 (-1, 145, '1'),
 1635 (-1, 146, '1'),
 1636 (-1, 147, '0'),
 1637 (-1, 148, '0'),
 1638 (-1, 149, '0'),
 1639 (-1, 150, '0'),
 1640 (-1, 151, ''),
 1641 (-1, 152, ''),
 1642 (-1, 153, ''),
 1643 (-1, 155, ''),
 1644 (-1, 156, '0'),
 1645 (-1, 157, ''),
 1646 (-1, 161, '0'),
 1647 (-1, 160, '1'),
 1648 (-1, 115, '0'),
 1649 (-1, 158, '6'),
 1650 (-1, 159, '');
 1651 
 1652 -- --------------------------------------------------------
 1653 
 1654 --
 1655 -- Table structure for table `user_pvmsg`
 1656 --
 1657 
 1658 DROP TABLE IF EXISTS `user_pvmsg`;
 1659 CREATE TABLE IF NOT EXISTS `user_pvmsg` (
 1660   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
 1661   `subject` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1662   `message` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1663   `from_user` int(11) UNSIGNED NOT NULL,
 1664   `to_user` int(11) UNSIGNED NOT NULL,
 1665   `is_read` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
 1666   `creation_date` int(11) UNSIGNED DEFAULT NULL,
 1667   PRIMARY KEY (`id`)
 1668 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1669 
 1670 -- --------------------------------------------------------
 1671 
 1672 --
 1673 -- Table structure for table `user_shout`
 1674 --
 1675 
 1676 DROP TABLE IF EXISTS `user_shout`;
 1677 CREATE TABLE IF NOT EXISTS `user_shout` (
 1678   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
 1679   `user` int(11) NOT NULL,
 1680   `text` text COLLATE utf8mb4_unicode_ci NOT NULL,
 1681   `date` int(11) UNSIGNED NOT NULL,
 1682   `sticky` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
 1683   `object_id` int(11) UNSIGNED NOT NULL,
 1684   `object_type` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1685   `data` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1686   PRIMARY KEY (`id`),
 1687   KEY `sticky` (`sticky`),
 1688   KEY `date` (`date`),
 1689   KEY `user` (`user`)
 1690 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1691 
 1692 -- --------------------------------------------------------
 1693 
 1694 --
 1695 -- Table structure for table `user_vote`
 1696 --
 1697 
 1698 DROP TABLE IF EXISTS `user_vote`;
 1699 CREATE TABLE IF NOT EXISTS `user_vote` (
 1700   `user` int(11) UNSIGNED NOT NULL,
 1701   `object_id` int(11) UNSIGNED NOT NULL,
 1702   `date` int(11) UNSIGNED NOT NULL,
 1703   `sid` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1704   KEY `user` (`user`),
 1705   KEY `object_id` (`object_id`),
 1706   KEY `date` (`date`)
 1707 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1708 
 1709 -- --------------------------------------------------------
 1710 
 1711 --
 1712 -- Table structure for table `video`
 1713 --
 1714 
 1715 DROP TABLE IF EXISTS `video`;
 1716 CREATE TABLE IF NOT EXISTS `video` (
 1717   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
 1718   `file` varchar(4096) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1719   `catalog` int(11) UNSIGNED NOT NULL,
 1720   `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1721   `video_codec` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1722   `audio_codec` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1723   `resolution_x` mediumint(8) UNSIGNED NOT NULL,
 1724   `resolution_y` mediumint(8) UNSIGNED NOT NULL,
 1725   `time` int(11) UNSIGNED NOT NULL,
 1726   `size` bigint(20) UNSIGNED NOT NULL,
 1727   `mime` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1728   `addition_time` int(11) UNSIGNED NOT NULL,
 1729   `update_time` int(11) UNSIGNED DEFAULT NULL,
 1730   `enabled` tinyint(1) NOT NULL DEFAULT 1,
 1731   `played` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
 1732   `release_date` int(11) DEFAULT NULL,
 1733   `channels` mediumint(9) DEFAULT NULL,
 1734   `bitrate` mediumint(8) DEFAULT NULL,
 1735   `video_bitrate` int(11) UNSIGNED DEFAULT NULL,
 1736   `display_x` mediumint(8) DEFAULT NULL,
 1737   `display_y` mediumint(8) DEFAULT NULL,
 1738   `frame_rate` float DEFAULT NULL,
 1739   `mode` enum('abr','vbr','cbr') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1740   `total_count` int(11) UNSIGNED NOT NULL DEFAULT 0,
 1741   `total_skip` int(11) UNSIGNED NOT NULL DEFAULT 0,
 1742   PRIMARY KEY (`id`),
 1743   KEY `file` (`file`(333)),
 1744   KEY `enabled` (`enabled`),
 1745   KEY `title` (`title`),
 1746   KEY `addition_time` (`addition_time`),
 1747   KEY `update_time` (`update_time`)
 1748 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1749 
 1750 -- --------------------------------------------------------
 1751 
 1752 --
 1753 -- Table structure for table `wanted`
 1754 --
 1755 
 1756 DROP TABLE IF EXISTS `wanted`;
 1757 CREATE TABLE IF NOT EXISTS `wanted` (
 1758   `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
 1759   `user` int(11) NOT NULL,
 1760   `artist` int(11) DEFAULT NULL,
 1761   `artist_mbid` varchar(1369) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1762   `mbid` varchar(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1763   `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 1764   `year` int(4) DEFAULT NULL,
 1765   `date` int(11) UNSIGNED NOT NULL DEFAULT 0,
 1766   `accepted` tinyint(1) NOT NULL DEFAULT 0,
 1767   PRIMARY KEY (`id`),
 1768   UNIQUE KEY `unique_wanted` (`user`,`artist`,`mbid`)
 1769 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 1770 
 1771 --
 1772 -- Indexes for dumped tables
 1773 --
 1774 
 1775 --
 1776 -- Indexes for table `album`
 1777 --
 1778 ALTER TABLE `album` ADD FULLTEXT KEY `name_2` (`name`);
 1779 
 1780 --
 1781 -- Indexes for table `artist`
 1782 --
 1783 ALTER TABLE `artist` ADD FULLTEXT KEY `name_2` (`name`);
 1784 
 1785 --
 1786 -- Indexes for table `song`
 1787 --
 1788 ALTER TABLE `song` ADD FULLTEXT KEY `title` (`title`);
 1789 COMMIT;
 1790 
 1791 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
 1792 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
 1793 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;