--
-- Host: localhost    Database: mm_admin
-- ------------------------------------------------------


--
-- Table structure for table `assets`
--

CREATE TABLE `assets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `db_id` int(11) DEFAULT NULL,
  `track_id` int(11) DEFAULT NULL,
  `asset_key` char(32) NOT NULL COMMENT 'Random md5 hash used for access security.',
  `Filename` varchar(255) NOT NULL,
  `Pathname` varchar(255) DEFAULT NULL,
  `FilePath` text,
  `Duration` varchar(20) DEFAULT NULL,
  `FileType` varchar(4) DEFAULT NULL,
  `CreationDate` datetime DEFAULT NULL,
  `ModificationDate` datetime DEFAULT NULL,
  `TrackTitle` varchar(255) DEFAULT NULL,
  `Composer` varchar(512) DEFAULT NULL,
  `Publisher` varchar(512) DEFAULT NULL,
  `TotalFrames` int(10) unsigned DEFAULT NULL,
  `EntryDate` double DEFAULT NULL,
  `Split` tinyint(1) unsigned DEFAULT NULL,
  `SplitChannels` tinyint(3) unsigned DEFAULT NULL,
  `SampleRate` int(5) unsigned DEFAULT NULL,
  `Channels` tinyint(3) unsigned DEFAULT NULL,
  `BitDepth` tinyint(3) unsigned DEFAULT NULL,
  `ChannelLayout` varchar(31) DEFAULT NULL,
  `_WaveformLink` int(10) unsigned DEFAULT NULL,
  `_PictureLink` int(10) unsigned DEFAULT NULL,
  `_UMID` varchar(64) DEFAULT NULL,
  `RecID` int(10) unsigned DEFAULT NULL,
  `Popularity` int(10) unsigned DEFAULT NULL,
  `Rating` int(10) unsigned DEFAULT NULL,
  `_FlatCategory` varchar(255) DEFAULT NULL,
  `Time` time DEFAULT NULL,
  `Volume` varchar(100) DEFAULT NULL,
  `Track` bigint(20) DEFAULT NULL,
  `Index` smallint(6) DEFAULT NULL,
  `_Dirty` smallint(6) DEFAULT NULL,
  `Lyrics` text,
  `Description` varchar(1000) DEFAULT NULL,
  `Source` varchar(64) DEFAULT NULL,
  `Category` varchar(64) DEFAULT NULL,
  `SubCategory` varchar(128) DEFAULT NULL,
  `FXName` varchar(128) DEFAULT NULL,
  `Notes` varchar(1000) DEFAULT NULL,
  `Show` varchar(62) DEFAULT NULL,
  `Library` varchar(150) DEFAULT NULL,
  `RecType` varchar(62) DEFAULT NULL,
  `ShortID` varchar(32) DEFAULT NULL,
  `LongID` varchar(128) DEFAULT NULL,
  `RecMedium` varchar(62) DEFAULT NULL,
  `Keywords` varchar(1000) DEFAULT NULL,
  `Location` varchar(128) DEFAULT NULL,
  `Microphone` varchar(62) DEFAULT NULL,
  `Arranger` varchar(128) DEFAULT NULL,
  `Conductor` varchar(128) DEFAULT NULL,
  `Performer` varchar(128) DEFAULT NULL,
  `BPM` varchar(31) DEFAULT NULL,
  `Key` varchar(15) DEFAULT NULL,
  `Manufacturer` varchar(150) DEFAULT NULL,
  `Designer` varchar(62) DEFAULT NULL,
  `CDTitle` varchar(128) DEFAULT NULL,
  `CDDescription` varchar(1000) DEFAULT NULL,
  `FeaturedInstrument` varchar(128) DEFAULT NULL,
  `Scene` varchar(31) DEFAULT NULL,
  `Take` varchar(31) DEFAULT NULL,
  `Tape` varchar(31) DEFAULT NULL,
  `Mood` varchar(1000) DEFAULT NULL,
  `Version` varchar(62) DEFAULT NULL,
  `BWDescription` varchar(1000) DEFAULT NULL,
  `BWOriginator` varchar(62) DEFAULT NULL,
  `BWOriginatorRef` varchar(62) DEFAULT NULL,
  `BWTimeStamp` varchar(11) DEFAULT NULL,
  `BWTime` varchar(8) DEFAULT NULL,
  `BWDate` varchar(10) DEFAULT NULL,
  `smint_track_id` varchar(50) DEFAULT NULL,
  `spectral_external_key` varchar(50) DEFAULT NULL,
  `TouchedDate` double DEFAULT NULL,
  `Artist` varchar(255) DEFAULT NULL,
  `Usage` varchar(128) DEFAULT NULL,
  `TrackYear` varchar(31) DEFAULT NULL,
  `UserComments` varchar(255) DEFAULT NULL,
  `Tempo` varchar(62) DEFAULT NULL,
  `NewSource` varchar(128) DEFAULT NULL,
  `_smint_track_id` varchar(50) DEFAULT NULL,
  `JDNotes` varchar(1000) DEFAULT NULL,
  `ReleaseDate` date DEFAULT NULL,
  `cdndate` datetime DEFAULT NULL,
  `cdnstale` tinyint(4) DEFAULT NULL,
  `foxnewname` varchar(50) DEFAULT NULL,
  `ScannedDate` datetime DEFAULT NULL,
  `ISRC` varchar(16) DEFAULT NULL,
  `URL` varchar(512) DEFAULT NULL,
  `_PathnameLink` int(10) unsigned DEFAULT NULL,
  `_CategoryLink` int(10) unsigned DEFAULT NULL,
  `_ManufacturerLink` int(10) unsigned DEFAULT NULL,
  `_LibraryLink` int(10) unsigned DEFAULT NULL,
  `_DesignerLink` int(10) unsigned DEFAULT NULL,
  `_CDTitleLink` int(10) unsigned DEFAULT NULL,
  `_ComposerLink` int(10) unsigned DEFAULT NULL,
  `_FeaturedInstrumentLink` int(10) unsigned DEFAULT NULL,
  `_BPMLink` int(10) unsigned DEFAULT NULL,
  `_VolumeLink` int(10) unsigned DEFAULT NULL,
  `_ShowLink` int(10) unsigned DEFAULT NULL,
  `_SceneLink` int(10) unsigned DEFAULT NULL,
  `_TapeLink` int(10) unsigned DEFAULT NULL,
  `_ShortIDLink` int(10) unsigned DEFAULT NULL,
  `_MoodLink` int(10) unsigned DEFAULT NULL,
  `_UsageLink` int(10) unsigned DEFAULT NULL,
  `CueTime` varchar(255) DEFAULT NULL,
  `CueInTime` varchar(255) DEFAULT NULL,
  `CueOutTime` varchar(255) DEFAULT NULL,
  `AudioFileType` varchar(4) DEFAULT NULL,
  `_Time` float unsigned DEFAULT NULL,
  `_FilePathHash` varchar(62) DEFAULT NULL,
  `_AudioCRC` varchar(32) DEFAULT NULL,
  `_Tags` varchar(255) DEFAULT NULL,
  `_OriginalFilename` varchar(255) DEFAULT NULL,
  `_SubCategoryLink` int(10) unsigned DEFAULT NULL,
  `_ArrangerLink` int(10) unsigned DEFAULT NULL,
  `_ArtistLink` int(10) unsigned DEFAULT NULL,
  `_ConductorLink` int(10) unsigned DEFAULT NULL,
  `_PublisherLink` int(10) unsigned DEFAULT NULL,
  `_PerformerLink` int(10) unsigned DEFAULT NULL,
  `_TrackYearLink` int(10) unsigned DEFAULT NULL,
  `_KeyLink` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `db_id_track_id_index` (`db_id`,`track_id`),
  KEY `RecID` (`RecID`),
  KEY `track_id` (`track_id`)
) ENGINE=MyISAM AUTO_INCREMENT=728 DEFAULT CHARSET=utf8;

--
-- Table structure for table `browsers`
--

CREATE TABLE `browsers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_agent` varchar(255) NOT NULL,
  `browser` varchar(64) NOT NULL,
  `version` float NOT NULL,
  `version_maj` int(11) NOT NULL,
  `version_min` int(11) NOT NULL,
  `platform` varchar(32) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `index` (`user_agent`)
) ENGINE=MyISAM AUTO_INCREMENT=156 DEFAULT CHARSET=utf8 COMMENT='Logs details about client browsers.';

--
-- Table structure for table `columns`
--

CREATE TABLE `columns` (
  `id` varchar(255) NOT NULL,
  `display` varchar(255) NOT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '0',
  `browse` tinyint(1) NOT NULL DEFAULT '0',
  `context` enum('metadata','cuesheet') NOT NULL DEFAULT 'metadata' COMMENT 'Indicates the application context where this column is valid.',
  `link` enum('none','field','word') DEFAULT 'field' COMMENT 'Type of live link to use for this column.',
  `split_text` varchar(50) DEFAULT NULL,
  `meta_browse_fields` text,
  PRIMARY KEY (`id`),
  KEY `active` (`active`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Mapping of user columns to database columns.';

--
-- Table structure for table `comm_cart_items`
--

CREATE TABLE `comm_cart_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date_created` timestamp NULL DEFAULT NULL,
  `cart_id` int(11) NOT NULL,
  `quantity` int(11) DEFAULT NULL,
  `Duration` time DEFAULT NULL,
  `CDTitle` varchar(100) DEFAULT NULL,
  `Description` varchar(1000) DEFAULT NULL,
  `Composer` varchar(255) DEFAULT NULL,
  `FilePath` varchar(255) DEFAULT NULL,
  `FileType` varchar(4) DEFAULT NULL,
  `Picture` mediumblob,
  `Waveform` mediumblob,
  `track_id` int(11) DEFAULT NULL,
  `TrackTitle` varchar(255) DEFAULT NULL,
  `Volume` varchar(100) DEFAULT NULL,
  `Library` varchar(150) DEFAULT NULL,
  `Manufacturer` varchar(150) DEFAULT NULL,
  `Publisher` varchar(255) DEFAULT NULL,
  `Source` varchar(62) DEFAULT NULL,
  `Category` varchar(62) DEFAULT NULL,
  `Version` varchar(31) DEFAULT NULL,
  `_WaveformLink` int(11) DEFAULT NULL,
  `_PictureLink` int(11) DEFAULT NULL,
  `db_id` int(11) DEFAULT NULL,
  `Picture_Hash` varchar(50) DEFAULT NULL,
  `Waveform_Hash` varchar(50) DEFAULT NULL,
  `Track` int(11) DEFAULT NULL,
  `_OriginalFilename` varchar(255) DEFAULT NULL,
  `_UMID` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `cart_id` (`cart_id`),
  KEY `track_id` (`track_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `comm_carts`
--

CREATE TABLE `comm_carts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `users_id` int(11) NOT NULL,
  `date_created` datetime DEFAULT NULL,
  `payment_token` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `users_id` (`users_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `comm_clearances`
--

CREATE TABLE `comm_clearances` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `parent_id` int(11) DEFAULT NULL,
  `position` float DEFAULT NULL,
  `name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `children_category` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `definition` text COLLATE utf8_unicode_ci,
  `parent_clearance` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_clearances_on_parent_id_and_position` (`parent_id`,`position`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `comm_coupons`
--

CREATE TABLE `comm_coupons` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `type` varchar(255) NOT NULL,
  `value` int(11) NOT NULL,
  `expiry` date NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `comm_markets`
--

CREATE TABLE `comm_markets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `position` float DEFAULT NULL,
  `name` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `definition` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `region_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `country_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `comm_order_items`
--

CREATE TABLE `comm_order_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date_created` timestamp NULL DEFAULT NULL,
  `order_id` int(11) NOT NULL,
  `quantity` int(11) DEFAULT NULL,
  `Duration` time DEFAULT NULL,
  `CDTitle` varchar(100) DEFAULT NULL,
  `Description` varchar(1000) DEFAULT NULL,
  `Composer` varchar(255) DEFAULT NULL,
  `FilePath` varchar(255) DEFAULT NULL,
  `FileType` varchar(4) DEFAULT NULL,
  `Picture` mediumblob,
  `Waveform` mediumblob,
  `track_id` int(11) DEFAULT NULL,
  `TrackTitle` varchar(255) DEFAULT NULL,
  `Volume` varchar(100) DEFAULT NULL,
  `Library` varchar(150) DEFAULT NULL,
  `Manufacturer` varchar(150) DEFAULT NULL,
  `Publisher` varchar(255) DEFAULT NULL,
  `Source` varchar(62) DEFAULT NULL,
  `Category` varchar(62) DEFAULT NULL,
  `Version` varchar(31) DEFAULT NULL,
  `_WaveformLink` int(11) DEFAULT NULL,
  `_PictureLink` int(11) DEFAULT NULL,
  `db_id` int(11) DEFAULT NULL,
  `Picture_Hash` varchar(50) DEFAULT NULL,
  `Waveform_Hash` varchar(50) DEFAULT NULL,
  `Track` int(11) DEFAULT NULL,
  `prod_type` varchar(255) DEFAULT NULL,
  `clearance` varchar(255) DEFAULT NULL,
  `territory` varchar(255) DEFAULT NULL,
  `term` varchar(255) DEFAULT NULL,
  `price` varchar(255) DEFAULT NULL,
  `item_group` varchar(255) DEFAULT NULL,
  `prod_type_text` varchar(255) DEFAULT NULL,
  `clearance_text` varchar(255) DEFAULT NULL,
  `territory_text` varchar(255) DEFAULT NULL,
  `term_text` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `cart_id` (`order_id`),
  KEY `track_id` (`track_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `comm_orders`
--

CREATE TABLE `comm_orders` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date_created` datetime DEFAULT NULL,
  `users_id` int(11) DEFAULT NULL,
  `cart_id` int(11) DEFAULT NULL,
  `sales_person_users_id` int(11) DEFAULT NULL,
  `sales_person_name` varchar(100) DEFAULT NULL,
  `clearance` varchar(50) DEFAULT NULL,
  `territory` varchar(50) DEFAULT NULL,
  `total` decimal(10,2) DEFAULT NULL,
  `tax` decimal(10,2) DEFAULT NULL,
  `gateway_response_raw` text,
  `status` varchar(25) NOT NULL DEFAULT 'pending',
  `approved` tinyint(4) NOT NULL DEFAULT '0',
  `payment_method` varchar(25) NOT NULL,
  `customer_notes` tinytext,
  `sales_notes` text,
  `rate_header_1` varchar(200) DEFAULT NULL,
  `rate_header_2` varchar(200) DEFAULT NULL,
  `rate_header_3` varchar(200) DEFAULT NULL,
  `rate_header_4` varchar(200) DEFAULT NULL,
  `rate_label_1` varchar(200) DEFAULT NULL,
  `rate_value_1` varchar(200) DEFAULT NULL,
  `rate_label_2` varchar(200) DEFAULT NULL,
  `rate_value_2` varchar(200) DEFAULT NULL,
  `rate_label_3` varchar(200) DEFAULT NULL,
  `rate_value_3` varchar(200) DEFAULT NULL,
  `rate_label_4` varchar(200) DEFAULT NULL,
  `rate_value_4` varchar(200) DEFAULT NULL,
  `order_tracking_info` varchar(50) DEFAULT NULL,
  `first_name` varchar(50) DEFAULT NULL,
  `last_name` varchar(50) DEFAULT NULL,
  `address1` varchar(255) DEFAULT NULL,
  `address2` varchar(255) DEFAULT NULL,
  `city` varchar(50) DEFAULT NULL,
  `region` varchar(50) DEFAULT NULL,
  `postal_code` varchar(30) DEFAULT NULL,
  `phone` varchar(32) DEFAULT NULL,
  `phone_fax` varchar(32) DEFAULT NULL,
  `notes` text,
  `series_film_title` varchar(100) DEFAULT NULL,
  `episode_spot_title` varchar(100) DEFAULT NULL,
  `station` varchar(100) DEFAULT NULL,
  `producer` varchar(100) DEFAULT NULL,
  `episode` varchar(100) DEFAULT NULL,
  `air_date` varchar(100) DEFAULT NULL,
  `studio` varchar(100) DEFAULT NULL,
  `credit_name_on_card` varchar(100) DEFAULT NULL,
  `credit_type` varchar(4) DEFAULT NULL,
  `credit_exp_month` int(11) DEFAULT NULL,
  `credit_exp_year` int(11) DEFAULT NULL,
  `credit_card_last_four` int(11) DEFAULT NULL,
  `company` varchar(100) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `job_title` varchar(50) DEFAULT NULL,
  `phone_cell` varchar(32) DEFAULT NULL,
  `country_iso` varchar(3) DEFAULT NULL,
  `rate_matrix_key_id` varchar(25) DEFAULT NULL,
  `rate_label_custom_1` varchar(50) DEFAULT NULL,
  `rate_label_custom_2` varchar(50) DEFAULT NULL,
  `rate_label_custom_3` varchar(50) DEFAULT NULL,
  `rate_label_custom_4` varchar(50) DEFAULT NULL,
  `rate_value_custom_1` float DEFAULT NULL,
  `rate_value_custom_2` float DEFAULT NULL,
  `rate_value_custom_3` float DEFAULT NULL,
  `rate_value_custom_4` float DEFAULT NULL,
  `license-first_name` varchar(255) DEFAULT NULL,
  `license-last_name` varchar(255) DEFAULT NULL,
  `license-company` varchar(255) DEFAULT NULL,
  `license-address1` varchar(255) DEFAULT NULL,
  `license-address2` varchar(255) DEFAULT NULL,
  `license-city` varchar(255) DEFAULT NULL,
  `license-region` varchar(255) DEFAULT NULL,
  `license-postal_code` varchar(255) DEFAULT NULL,
  `license-country_iso` varchar(255) DEFAULT NULL,
  `license-phone` varchar(255) DEFAULT NULL,
  `license-phone_cell` varchar(255) DEFAULT NULL,
  `license-phone_fax` varchar(255) DEFAULT NULL,
  `license-email` varchar(255) DEFAULT NULL,
  `license-job_title` varchar(255) DEFAULT NULL,
  `payment_id` int(11) DEFAULT NULL,
  `onepage_id` varchar(255) NOT NULL,
  `applied_coupon` text NOT NULL,
  `discounted_price` varchar(255) NOT NULL,
  `coupon_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `comm_payment_methods`
--

CREATE TABLE `comm_payment_methods` (
  `id` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `comm_payments`
--

CREATE TABLE `comm_payments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `payment_user_id` int(11) NOT NULL,
  `payment_order_id` int(11) NOT NULL,
  `payment_token` varchar(255) NOT NULL,
  `payment_amount` varchar(255) NOT NULL,
  `payment_type` varchar(255) DEFAULT NULL,
  `payment_gateway` varchar(255) DEFAULT NULL,
  `payment_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `payment_transaction_id` varchar(255) DEFAULT NULL,
  `payment_payer_id` varchar(255) DEFAULT NULL,
  `payment_email` varchar(255) DEFAULT NULL,
  `payment_firstname` varchar(255) DEFAULT NULL,
  `payment_lastname` varchar(255) DEFAULT NULL,
  `payment_countrycode` varchar(255) DEFAULT NULL,
  `payment_fee` varchar(255) DEFAULT NULL,
  `payment_tax` varchar(255) DEFAULT NULL,
  `payment_responsereason` text,
  `payment_status` varchar(255) NOT NULL,
  `payment_order_data` longtext,
  `payment_currency` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `comm_price`
--

CREATE TABLE `comm_price` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `db` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `manufact` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `lib` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `album` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `rec_um_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `path` text COLLATE utf8_unicode_ci NOT NULL,
  `price` text COLLATE utf8_unicode_ci NOT NULL,
  `created` timestamp NULL DEFAULT NULL,
  `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_index` (`db`,`rec_um_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `comm_price_old`
--

CREATE TABLE `comm_price_old` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `data` longtext NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `comm_rate_card_custom_clearances`
--

CREATE TABLE `comm_rate_card_custom_clearances` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `position` float DEFAULT NULL,
  `name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `definition` text COLLATE utf8_unicode_ci,
  `factor` float DEFAULT NULL,
  `value` decimal(10,2) NOT NULL DEFAULT '0.00',
  PRIMARY KEY (`id`),
  KEY `index_clearances_on_parent_id_and_position` (`position`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `comm_rate_card_custom_durations`
--

CREATE TABLE `comm_rate_card_custom_durations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `position` float DEFAULT NULL,
  `name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `duration` float DEFAULT NULL,
  `duration_unit` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL,
  `definition` text COLLATE utf8_unicode_ci,
  `factor` float DEFAULT NULL,
  `value` decimal(10,2) NOT NULL DEFAULT '0.00',
  PRIMARY KEY (`id`),
  KEY `index_clearances_on_parent_id_and_position` (`position`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `comm_rate_card_custom_prod_types`
--

CREATE TABLE `comm_rate_card_custom_prod_types` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `position` float DEFAULT NULL,
  `name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `definition` text COLLATE utf8_unicode_ci,
  `factor` float DEFAULT NULL,
  `value` decimal(10,2) NOT NULL DEFAULT '0.00',
  PRIMARY KEY (`id`),
  KEY `index_clearances_on_parent_id_and_position` (`position`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `comm_rate_card_custom_territories`
--

CREATE TABLE `comm_rate_card_custom_territories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `position` float DEFAULT NULL,
  `name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `definition` text COLLATE utf8_unicode_ci,
  `factor` float DEFAULT NULL,
  `value` decimal(10,2) NOT NULL DEFAULT '0.00',
  PRIMARY KEY (`id`),
  KEY `index_clearances_on_parent_id_and_position` (`position`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `comm_rate_card_presets`
--

CREATE TABLE `comm_rate_card_presets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sales_person_users_id` int(11) NOT NULL,
  `users_id` int(11) NOT NULL,
  `rate_info` text NOT NULL,
  `rate_matrix_key_id` varchar(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `users_id` (`users_id`),
  KEY `rate_matrix_key_id` (`rate_matrix_key_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `comm_rates`
--

CREATE TABLE `comm_rates` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `clearance_id` int(11) DEFAULT NULL,
  `market_id` int(11) DEFAULT NULL,
  `price` int(11) DEFAULT NULL,
  `license_type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_rates_on_clearance_id_and_market_id` (`clearance_id`,`market_id`),
  KEY `index_rates_on_market_id` (`market_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `cookies`
--

CREATE TABLE `cookies` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `hash` char(32) NOT NULL DEFAULT '',
  `user_id` int(11) NOT NULL DEFAULT '0',
  `expires` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='Manages "remember me" cookies.';

--
-- Table structure for table `countries`
--

CREATE TABLE `countries` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `iso` varchar(3) NOT NULL,
  `country_name` varchar(75) NOT NULL,
  `custom_order` int(11) DEFAULT NULL,
  `iso_two_chars` varchar(2) DEFAULT NULL,
  `regional_site_title` varchar(255) DEFAULT NULL,
  `regional_site_description` text,
  `regional_site_keywords` text,
  `regional_reg_emails` text,
  `regional_help_url` text,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_countries_iso` (`iso`),
  KEY `country_name` (`country_name`),
  KEY `custom_order` (`custom_order`)
) ENGINE=MyISAM AUTO_INCREMENT=311 DEFAULT CHARSET=latin1;

--
-- Table structure for table `databases`
--

CREATE TABLE `databases` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '',
  `schema` varchar(30) NOT NULL DEFAULT '',
  `version` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `version_min` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `display` varchar(255) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '0',
  `active` tinyint(1) NOT NULL DEFAULT '0',
  `proxy_id` int(11) DEFAULT '0',
  `perm_columns` varchar(255) NOT NULL DEFAULT '["Library","CDTitle","Filename"]',
  `group_columns` varchar(255) NOT NULL DEFAULT '["Library","CDTitle","TrackTitle"]',
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='List of known Soundminer library databases.';

--
-- Table structure for table `download_cron`
--

CREATE TABLE `download_cron` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `user_cookie` varchar(255) DEFAULT NULL,
  `progressurl` varchar(255) DEFAULT NULL,
  `dlurl` varchar(255) DEFAULT NULL,
  `playlist_name` varchar(255) DEFAULT NULL,
  `status` int(11) DEFAULT '0',
  `download_status` int(11) DEFAULT '0',
  `updated_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=latin1;

--
-- Table structure for table `folder_states`
--

CREATE TABLE `folder_states` (
  `user_id` int(11) NOT NULL,
  `type` enum('section','group','shared','folder','cuesheet','playlist') NOT NULL DEFAULT 'folder' COMMENT 'Indicates which table, `folders`, `cuesheets`, or `playlists` that `id` is associated with.',
  `id` int(11) NOT NULL,
  `state` enum('open','closed','hidden') NOT NULL,
  PRIMARY KEY (`user_id`,`type`,`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Many to one relationship between users and folder state (i.e';

--
-- Table structure for table `folders`
--

CREATE TABLE `folders` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `owner_id` int(11) DEFAULT NULL COMMENT 'Owner ID: > 0 = user_id, < 0 = group_id.',
  `type` enum('private','inbox','published','shared') DEFAULT NULL COMMENT 'Internal flag which determines project tree placement and handling.',
  `o_access` set('read','add','modify','delete','root') DEFAULT NULL COMMENT 'Bit flags that control owner''s access to this content.',
  `s_access` set('read','add','modify','delete','root') DEFAULT NULL COMMENT 'Bit flags that control other user''s access to shared content.',
  `root_id` int(11) NOT NULL COMMENT 'Root folder with owner and access settings.',
  `folder_id` int(11) NOT NULL DEFAULT '0' COMMENT 'Parent folder containing this folder.',
  `path` varchar(1000) NOT NULL COMMENT 'Tree hierachy path.',
  `name` varchar(128) NOT NULL DEFAULT 'Folder' COMMENT 'Name of this folder as it appears in parent project folder.',
  `created` datetime NOT NULL COMMENT 'Timestamp of the original creation of row.',
  `updated` datetime NOT NULL COMMENT 'Timestamp of the last modification of row.',
  `deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Deleted flag.',
  `updated_by` int(11) NOT NULL DEFAULT '0' COMMENT 'User ID of user making the last modification of row.',
  `orig_id` int(11) DEFAULT NULL COMMENT 'Transient field used when doing complex copy operations.',
  `section` enum('playlists','cuesheets') DEFAULT 'playlists',
  `cuesheet_title` varchar(100) DEFAULT NULL,
  `cuesheet_company` varchar(100) DEFAULT NULL,
  `cuesheet_description` varchar(250) DEFAULT NULL,
  `cuesheet_network` varchar(100) DEFAULT NULL,
  `cuesheet_address1` varchar(100) DEFAULT NULL,
  `cuesheet_address2` varchar(100) DEFAULT NULL,
  `cuesheet_city` varchar(50) DEFAULT NULL,
  `cuesheet_region` varchar(50) DEFAULT NULL,
  `cuesheet_postal` varchar(25) DEFAULT NULL,
  `cuesheet_country_iso` varchar(3) DEFAULT NULL,
  `cuesheet_phone` varchar(25) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `folder_id` (`folder_id`),
  KEY `path_index` (`path`(333)),
  KEY `orig_id_index` (`orig_id`),
  KEY `updated_by` (`updated_by`),
  KEY `root_id` (`root_id`),
  KEY `owner_id` (`owner_id`)
) ENGINE=MyISAM AUTO_INCREMENT=79 DEFAULT CHARSET=utf8;

--
-- Table structure for table `global_user_comment`
--

CREATE TABLE `global_user_comment` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `db_id` int(11) NOT NULL,
  `metadata_id` int(11) NOT NULL,
  `comment` text COLLATE utf8_unicode_ci NOT NULL,
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `groups`
--

CREATE TABLE `groups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '0',
  `notes` text,
  `settings_id` int(11) NOT NULL COMMENT 'Group''s settings.',
  `folder_id` int(11) NOT NULL COMMENT 'Root folder of group''s shared project content.',
  PRIMARY KEY (`id`),
  KEY `user_id` (`name`),
  KEY `folder_index` (`folder_id`,`id`),
  KEY `settings_id` (`settings_id`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;

--
-- Table structure for table `help`
--

CREATE TABLE `help` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique help page identifier.',
  `date_created` datetime NOT NULL,
  `sequence` int(11) NOT NULL DEFAULT '0',
  `title` varchar(255) NOT NULL COMMENT 'Displayable topic title.',
  `content` text NOT NULL COMMENT 'Help topic content.',
  PRIMARY KEY (`id`),
  FULLTEXT KEY `search` (`title`,`content`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

--
-- Table structure for table `history`
--

CREATE TABLE `history` (
  `user_id` int(11) NOT NULL DEFAULT '0',
  `level` int(10) unsigned NOT NULL DEFAULT '0',
  `kind` enum('home','search','mod') NOT NULL DEFAULT 'home',
  `lock` tinyint(1) NOT NULL DEFAULT '0',
  `text` text CHARACTER SET latin1 NOT NULL,
  `ftext` text NOT NULL,
  `s_src_type` enum('db','special','folder','playlist','smart','cuesheet') NOT NULL,
  `s_src_id` int(11) NOT NULL,
  `s_result_vista` enum('albums','mixed','tracks') NOT NULL,
  `s_result_nondown` tinyint(1) NOT NULL,
  `s_track_columns` text NOT NULL,
  `s_browse_show` tinyint(1) NOT NULL,
  `s_browse_columns` text NOT NULL,
  `s_track_order` varchar(255) NOT NULL,
  `s_track_index` int(11) NOT NULL,
  `s_track_limit` int(11) NOT NULL,
  `s_track_grouping` enum('off','on') NOT NULL,
  `s_track_view` enum('auto','fixed') NOT NULL,
  `public_session_id` varchar(40) NOT NULL DEFAULT '',
  PRIMARY KEY (`user_id`,`level`,`public_session_id`),
  KEY `level_index` (`level`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='History stack of user queries';

--
-- Table structure for table `hosts`
--

CREATE TABLE `hosts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ip` varchar(64) NOT NULL,
  `name` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `index` (`ip`,`name`)
) ENGINE=MyISAM AUTO_INCREMENT=324 DEFAULT CHARSET=utf8;

--
-- Table structure for table `html_site_customizations`
--

CREATE TABLE `html_site_customizations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date_created` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `login_head` text COMMENT 'Custom HTML to insert at end of <head></head>.',
  `login_body1` text COMMENT 'Custom HTML to insert at start of <body></body>.',
  `login_body2` text COMMENT 'Custom HTML to insert at end of <body></body>.',
  `main_head` text COMMENT 'Custom HTML to insert at end of <head></head>.',
  `main_body1` text COMMENT 'Custom HTML to insert at start of <body></body>.',
  `main_body2` text COMMENT 'Custom HTML to insert at end of <body></body>.',
  `admin_head` text COMMENT 'Custom HTML to insert at end of <head></head>.',
  `admin_body1` text COMMENT 'Custom HTML to insert at start of <body></body>.',
  `admin_body2` text COMMENT 'Custom HTML to insert at end of <body></body>.',
  `widgets_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `widgets_id` (`widgets_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `log`
--

CREATE TABLE `log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique sequence event ID.',
  `time` datetime NOT NULL COMMENT 'Date/time of event occurrence.',
  `event` enum('login','logout','search','audition','download','error') NOT NULL COMMENT 'The event that occurred and indicates which log tables contain further info.',
  `user_id` int(11) DEFAULT NULL COMMENT 'ID of logged in user causing the event.',
  `group_id` int(11) DEFAULT NULL COMMENT 'ID of logged in user''s group causing the event.',
  `role_id` int(11) DEFAULT NULL COMMENT 'ID of logged in user''s role causing the event.',
  `host_id` int(11) NOT NULL COMMENT 'ID of client machine accessing the server during the event.',
  `browser_id` int(11) NOT NULL DEFAULT '1' COMMENT 'ID of client browser accessing the server during the event.',
  `ctrl_name` varchar(15) DEFAULT NULL,
  `ctrl_related_id` int(11) DEFAULT NULL,
  `IP` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_event_index` (`user_id`,`event`),
  KEY `idx_log_time` (`time`),
  KEY `idx_log_host` (`host_id`),
  KEY `idx_log_browser` (`browser_id`),
  KEY `idx_onepages_stats` (`ctrl_name`,`ctrl_related_id`),
  KEY `group_id` (`group_id`),
  KEY `role_id` (`role_id`),
  KEY `user_id` (`user_id`)
) ENGINE=MyISAM AUTO_INCREMENT=10821 DEFAULT CHARSET=utf8;

--
-- Table structure for table `log_downloads`
--

CREATE TABLE `log_downloads` (
  `log_id` int(11) NOT NULL,
  `asset_id` int(11) NOT NULL,
  `db_id` int(11) NOT NULL,
  `track_id` int(11) NOT NULL,
  `file_path` varchar(3000) NOT NULL,
  `file_size` int(10) unsigned NOT NULL,
  `file_type` varchar(255) DEFAULT NULL,
  `completed` tinyint(1) NOT NULL,
  PRIMARY KEY (`log_id`),
  KEY `asset_id` (`asset_id`),
  KEY `file_type` (`file_type`),
  KEY `file_path` (`file_path`(333)),
  KEY `file_size` (`file_size`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `log_logins`
--

CREATE TABLE `log_logins` (
  `log_id` int(11) NOT NULL DEFAULT '0',
  `login_id` int(11) DEFAULT NULL COMMENT 'The matching logout, for logins, or login, for logouts, event ID.',
  `method` enum('user','auto') NOT NULL COMMENT 'The method or reason for the login or logout.',
  PRIMARY KEY (`log_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `log_searches`
--

CREATE TABLE `log_searches` (
  `log_id` int(10) unsigned NOT NULL,
  `query_id` int(11) NOT NULL DEFAULT '0',
  `lock` tinyint(1) NOT NULL,
  `text` text NOT NULL,
  `total` int(11) NOT NULL,
  PRIMARY KEY (`log_id`),
  KEY `query_id` (`query_id`),
  KEY `total` (`total`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `media`
--

CREATE TABLE `media` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `title` varchar(255) NOT NULL DEFAULT '',
  `description` text,
  `file_size` decimal(10,2) NOT NULL,
  `mime_type` varchar(25) NOT NULL DEFAULT '',
  `filename` varchar(255) NOT NULL DEFAULT '',
  `users_id` int(11) NOT NULL,
  `extension` varchar(25) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

--
-- Table structure for table `mimes`
--

CREATE TABLE `mimes` (
  `name` varchar(255) NOT NULL DEFAULT '',
  `type` varchar(30) NOT NULL DEFAULT '',
  `subtype` varchar(30) NOT NULL,
  `ext` varchar(255) NOT NULL DEFAULT '',
  `mime` varchar(255) NOT NULL,
  PRIMARY KEY (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `onepage_chat`
--

CREATE TABLE `onepage_chat` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `onepage_id` varchar(255) NOT NULL,
  `recipient_email` varchar(255) NOT NULL,
  `recipient_name` varchar(255) NOT NULL,
  `comment_by` enum('creator','recipient') NOT NULL,
  `comment` text NOT NULL,
  `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

--
-- Table structure for table `onepage_emailed`
--

CREATE TABLE `onepage_emailed` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sender_id` int(11) DEFAULT NULL,
  `onepage_id` varchar(255) NOT NULL,
  `recipient_email` varchar(255) NOT NULL,
  `downloaded` int(11) NOT NULL,
  `auditioned` int(11) NOT NULL,
  `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

--
-- Table structure for table `onepages`
--

CREATE TABLE `onepages` (
  `id` varchar(255) NOT NULL,
  `user_id` int(11) NOT NULL,
  `playlist_id` int(11) NOT NULL,
  `orig_playlist_id` int(11) NOT NULL,
  `title` varchar(255) DEFAULT NULL,
  `columns` varchar(255) NOT NULL,
  `download` tinyint(1) NOT NULL DEFAULT '0',
  `password` varchar(50) DEFAULT NULL,
  `expires` datetime DEFAULT NULL,
  `created` datetime NOT NULL COMMENT 'Timestamp of the original creation of row.',
  `updated` datetime NOT NULL COMMENT 'Timestamp of the last modification of row.',
  `sort_order_rename` tinyint(4) DEFAULT NULL,
  `general_notes` text,
  `id_incremental` int(11) NOT NULL AUTO_INCREMENT,
  `pitch_display` tinyint(4) NOT NULL DEFAULT '0',
  `pitch_type` varchar(25) DEFAULT NULL,
  `pitch_performer_name` varchar(100) DEFAULT NULL,
  `pitch_purpose` varchar(25) DEFAULT NULL,
  `pitch_method` varchar(25) DEFAULT NULL,
  `pitch_status` varchar(25) DEFAULT NULL,
  `pitch_to` varchar(100) DEFAULT NULL,
  `pitch_contact_role` varchar(50) DEFAULT NULL,
  `pitch_notes` text,
  `register_with_external_app` tinyint(4) DEFAULT '0',
  `password_required` tinyint(4) DEFAULT '0',
  `is_public` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id_incremental`),
  UNIQUE KEY `id` (`id`),
  KEY `user_id` (`user_id`),
  KEY `expires` (`expires`)
) ENGINE=MyISAM AUTO_INCREMENT=71 DEFAULT CHARSET=utf8;

--
-- Table structure for table `perms`
--

CREATE TABLE `perms` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_reports` tinyint(1) DEFAULT NULL,
  `select_db` tinyint(1) DEFAULT NULL,
  `file_exts` tinyint(1) DEFAULT NULL,
  `email_playlists` tinyint(1) DEFAULT NULL COMMENT 'Allow user to email playlists with auditionable links.',
  `group_add` tinyint(1) DEFAULT NULL,
  `group_remove` tinyint(1) DEFAULT NULL,
  `group_reports` tinyint(1) DEFAULT NULL,
  `group_permissions` tinyint(1) DEFAULT NULL,
  `admin_home` tinyint(1) DEFAULT NULL,
  `admin_users` tinyint(1) DEFAULT NULL,
  `admin_reports` tinyint(1) DEFAULT NULL,
  `admin_columns` tinyint(1) DEFAULT NULL,
  `admin_databases` tinyint(1) DEFAULT NULL,
  `admin_site` tinyint(1) DEFAULT NULL,
  `assets` longtext,
  `columns` longtext,
  `sort_tracks` longtext,
  `sort_albums` longtext,
  `opt_home` enum('enabled','disabled') DEFAULT NULL COMMENT 'Enable/disable the home screen functionality and interface.',
  `opt_view` enum('user','auto','fixed') DEFAULT NULL COMMENT 'Allow user to choose results view or force ''auto'' or ''fixed'' view.',
  `opt_vista` enum('user','albums','mixed','tracks') DEFAULT NULL COMMENT 'Allow user to choose results vista or force ''albums'', ''mixed'', or ''tracks'' vista.',
  `opt_browse` enum('user','show','hide') DEFAULT NULL COMMENT 'Allow user to show/hide metabrowser or force ''show'' or ''hide''.',
  `opt_grouping` enum('user','off','on') DEFAULT NULL COMMENT 'Allow user to turn grouping on/off for result tracks or force ''on'' or ''off''.',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `playlists`
--

CREATE TABLE `playlists` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `root_id` int(11) NOT NULL COMMENT 'Root folder with owner and access settings.',
  `folder_id` int(11) NOT NULL DEFAULT '0' COMMENT 'Parent folder containing this playlist. NULL = deleted.',
  `path` varchar(1000) NOT NULL COMMENT 'Tree hierachy path.',
  `type` enum('playlist','cuesheet') NOT NULL DEFAULT 'playlist' COMMENT 'The list type as created by the user.',
  `name` varchar(128) NOT NULL DEFAULT 'Playlist' COMMENT 'Name of this playlist as it appears to the user.',
  `title` varchar(200) DEFAULT NULL,
  `episode` varchar(128) DEFAULT NULL COMMENT 'Episode title if part of a series.',
  `episode_no` varchar(12) DEFAULT NULL COMMENT 'Episode number if part of a series.',
  `production_no` varchar(100) DEFAULT NULL,
  `airdate` date DEFAULT NULL COMMENT 'Original or estimated airdate.',
  `length` time DEFAULT NULL COMMENT 'Normal run time of program or length of film.',
  `program_type` varchar(100) DEFAULT NULL,
  `version_type` varchar(100) DEFAULT NULL,
  `job_no` varchar(100) DEFAULT NULL,
  `station` varchar(128) DEFAULT NULL COMMENT 'Network station associated with the program.',
  `producer` varchar(128) DEFAULT NULL COMMENT 'Producer of the film or program.',
  `distributor` varchar(128) DEFAULT NULL COMMENT 'Distributor of the film or program.',
  `director` varchar(128) DEFAULT NULL COMMENT 'Director of the film or program.',
  `isci` varchar(14) DEFAULT NULL COMMENT 'Commercial spot ISCI Code or Ad-ID.',
  `contact` varchar(1000) DEFAULT NULL COMMENT 'Person or company, with address and contact info., who produced the program, prepared, or should be contacted regarding, the cuesheet.',
  `contact_type` enum('contact','prepared','produced') NOT NULL DEFAULT 'contact' COMMENT 'The entity which the `contact` field refers.',
  `notes` varchar(10000) DEFAULT NULL COMMENT 'User''s notes attached to this cuesheet.',
  `created` datetime NOT NULL COMMENT 'Timestamp of the original creation of row.',
  `updated` datetime NOT NULL COMMENT 'Timestamp of the last modification of row.',
  `deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Deleted flag.',
  `updated_by` int(11) NOT NULL DEFAULT '0' COMMENT 'User ID of user making the last modification of row.',
  `orig_id` int(11) DEFAULT NULL COMMENT 'Transient field used when doing complex copy operations.',
  `status` tinyint(1) DEFAULT NULL,
  `status_id` int(4) DEFAULT NULL,
  `rate_id` int(4) DEFAULT NULL,
  `clearance_id` int(4) DEFAULT NULL,
  `market_id` int(4) DEFAULT NULL,
  `broadcast` tinyint(4) DEFAULT NULL,
  `creator_id` varchar(25) DEFAULT NULL,
  `production_company` varchar(100) DEFAULT NULL,
  `category` varchar(25) DEFAULT NULL,
  `production_year` varchar(4) DEFAULT NULL,
  `animation_indicator` tinyint(4) DEFAULT '0',
  `master_cuesheet_indicator` tinyint(4) DEFAULT '0',
  `public` tinyint(4) NOT NULL DEFAULT '0',
  `originator_first_name` varchar(50) DEFAULT NULL,
  `originator_last_name` varchar(50) DEFAULT NULL,
  `originator_email` varchar(255) DEFAULT NULL,
  `originator_user_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `folder_id_index` (`folder_id`),
  KEY `path_index` (`path`(333)),
  KEY `orig_id_index` (`orig_id`),
  KEY `updated_by` (`updated_by`),
  KEY `deleted` (`deleted`),
  KEY `title` (`title`),
  KEY `root_id` (`root_id`),
  KEY `type` (`type`)
) ENGINE=MyISAM AUTO_INCREMENT=48 DEFAULT CHARSET=utf8;

--
-- Table structure for table `proxies`
--

CREATE TABLE `proxies` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `db_id` int(11) NOT NULL,
  `display` varchar(255) NOT NULL,
  `mime_name` varchar(255) NOT NULL DEFAULT 'From Metadata' COMMENT '''From Metadata'' = use type given in `metadata` table row',
  `channel_layout` enum('From Metadata','','L/R','L/C/R','L/R/S','L/R/Ls/Rs','L/C/R/S','L/C/R/Ls/Rs/LFE','A1/A2/A3/A4/A5/A6') NOT NULL DEFAULT 'From Metadata',
  `asset_path_prefix` varchar(255) NOT NULL,
  `proxy_path_prefix` varchar(255) NOT NULL,
  `asset_file_prefix` varchar(255) NOT NULL,
  `proxy_file_prefix` varchar(255) NOT NULL DEFAULT '',
  `asset_file_suffix` varchar(255) NOT NULL DEFAULT '',
  `proxy_file_suffix` varchar(255) NOT NULL DEFAULT '',
  `is_asset` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `db_id` (`db_id`)
) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

--
-- Table structure for table `queries`
--

CREATE TABLE `queries` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `databases` varchar(512) NOT NULL,
  `query` varchar(16383) NOT NULL,
  `query_trim` varchar(500) DEFAULT NULL,
  `databases_trim` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `databases_trim` (`databases_trim`),
  KEY `query_trim` (`query_trim`(333))
) ENGINE=MyISAM AUTO_INCREMENT=1569 DEFAULT CHARSET=utf8;

--
-- Table structure for table `quick_search_options`
--

CREATE TABLE `quick_search_options` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `search_criteria` varchar(1000) DEFAULT NULL,
  `description` varchar(1000) NOT NULL,
  `playlist_id` int(11) DEFAULT NULL,
  `widgets_id` int(11) DEFAULT NULL,
  `img` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=21 DEFAULT CHARSET=latin1;

--
-- Table structure for table `reports`
--

CREATE TABLE `reports` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(64) NOT NULL DEFAULT '' COMMENT 'Report title and template name.',
  `description` varchar(255) NOT NULL DEFAULT '' COMMENT 'Report description.',
  `time` enum('cday','cweek','cmonth','cyear','lday','lweek','lmonth','lyear','all','custom') NOT NULL DEFAULT 'cday' COMMENT 'Time period covered by report.',
  `begin` datetime DEFAULT '0000-00-00 00:00:00' COMMENT 'Start of custom time period.',
  `end` datetime DEFAULT '0000-00-00 00:00:00' COMMENT 'End of custom time period.',
  `users` int(11) NOT NULL DEFAULT '0' COMMENT 'User or -group ID to include in report.',
  `tables` varchar(10000) NOT NULL DEFAULT '' COMMENT 'JSON array of structures representing report tables.',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=53 DEFAULT CHARSET=utf8;

--
-- Table structure for table `roles`
--

CREATE TABLE `roles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `notes` varchar(255) NOT NULL,
  `settings_id` int(11) NOT NULL COMMENT 'Role''s settings.',
  PRIMARY KEY (`id`),
  KEY `settings_id` (`settings_id`),
  KEY `name` (`name`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;

--
-- Table structure for table `schema`
--

CREATE TABLE `schema` (
  `schema` varchar(30) CHARACTER SET latin1 NOT NULL DEFAULT '',
  `db_ver` varchar(30) NOT NULL,
  `mm_ver` varchar(30) NOT NULL,
  `sm_ver` varchar(30) NOT NULL,
  `guid` varchar(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 MAX_ROWS=1;

--
-- Table structure for table `search_topics_options`
--

CREATE TABLE `search_topics_options` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `search_criteria` varchar(1000) DEFAULT NULL,
  `description` varchar(1000) NOT NULL,
  `playlist_id` int(11) DEFAULT NULL,
  `widgets_id` int(11) DEFAULT NULL,
  `sequence` int(11) DEFAULT NULL,
  `parent_title` varchar(100) DEFAULT NULL,
  `header_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

--
-- Table structure for table `search_topics_options_headers`
--

CREATE TABLE `search_topics_options_headers` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(100) NOT NULL DEFAULT '',
  `sequence` int(11) NOT NULL DEFAULT '0',
  `widgets_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

--
-- Table structure for table `searches`
--

CREATE TABLE `searches` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `root_id` int(11) NOT NULL COMMENT 'Root folder with owner and access settings.',
  `folder_id` int(11) NOT NULL DEFAULT '0' COMMENT 'Parent folder containing this folder. NULL = deleted.',
  `path` varchar(1000) NOT NULL COMMENT 'Tree hierachy path. empty = deleted.',
  `name` varchar(128) NOT NULL COMMENT 'Name of this search as it appears in parent project folder.',
  `text` text NOT NULL,
  `created` datetime NOT NULL COMMENT 'Timestamp of the original creation of row.',
  `updated` datetime NOT NULL COMMENT 'Timestamp of the last modification of row.',
  `deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Deleted flag.',
  `updated_by` int(11) NOT NULL DEFAULT '0' COMMENT 'User ID of user making the last modification of row.',
  `orig_id` int(11) DEFAULT NULL COMMENT 'Transient field used when doing complex copy operations.',
  PRIMARY KEY (`id`),
  KEY `folder_id` (`folder_id`),
  KEY `path_index` (`path`(333)),
  KEY `orig_id_index` (`orig_id`)
) ENGINE=MyISAM AUTO_INCREMENT=27 DEFAULT CHARSET=utf8 COMMENT='User''s saved search queries';

--
-- Table structure for table `selective_search_groups`
--

CREATE TABLE `selective_search_groups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date_created` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `name` varchar(50) NOT NULL,
  `sequence` float DEFAULT NULL,
  `group_type` enum('or','and') DEFAULT NULL,
  `description` varchar(250) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

--
-- Table structure for table `selective_search_options`
--

CREATE TABLE `selective_search_options` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `search_criteria` varchar(250) DEFAULT NULL,
  `description` varchar(250) NOT NULL,
  `sequence` float DEFAULT NULL,
  `group_id` int(11) DEFAULT NULL,
  `batch_id` varchar(25) DEFAULT NULL,
  `search_criteria_exclude` varchar(250) DEFAULT NULL,
  `parent_title` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

--
-- Table structure for table `sessions`
--

CREATE TABLE `sessions` (
  `id` varchar(255) CHARACTER SET latin1 NOT NULL DEFAULT '',
  `data` text CHARACTER SET latin1 NOT NULL,
  `touched` int(11) NOT NULL,
  `uid` int(11) DEFAULT NULL,
  `logout` tinyint(1) NOT NULL DEFAULT '0',
  `reason` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `uid_index` (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `p_admin_users` tinyint(1) DEFAULT NULL COMMENT 'Permit administration of users.',
  `p_admin_reports` tinyint(1) DEFAULT NULL COMMENT 'Permit administration of reports.',
  `p_admin_site` tinyint(1) DEFAULT NULL COMMENT 'Permit administration of the site''s design, style, and options.',
  `p_admin_library` tinyint(1) DEFAULT NULL COMMENT 'Permit administration of databases, assets, and metadata.',
  `p_admin_system` tinyint(1) DEFAULT NULL COMMENT 'Permit administration of the system.',
  `p_assets` longtext COMMENT 'JSON structure of asset permissions.',
  `p_columns` longtext COMMENT 'JSON structure of column permissions.',
  `p_proxies` longtext COMMENT 'JSON structure of proxy permissions.',
  `u_sort_tracks` tinyint(1) DEFAULT NULL COMMENT 'User can change sort order of track results.',
  `u_sort_albums` tinyint(1) DEFAULT NULL COMMENT 'User can change sort order of ablums.',
  `u_src_type` tinyint(1) DEFAULT NULL COMMENT 'User can change source type.',
  `u_src_id` tinyint(1) DEFAULT NULL COMMENT 'User can change soure ID.',
  `u_result_vista` tinyint(1) DEFAULT NULL COMMENT 'User can change the results view.',
  `u_result_nondown` tinyint(1) DEFAULT NULL COMMENT 'User can change hide non-downloadable results.',
  `u_track_columns` tinyint(1) DEFAULT NULL COMMENT 'User can change track result columns.',
  `u_track_order` tinyint(1) DEFAULT NULL COMMENT 'User can change track result order.',
  `u_track_limit` tinyint(1) DEFAULT NULL COMMENT 'User can change track result page limit.',
  `u_track_grouping` tinyint(1) DEFAULT NULL COMMENT 'User can change track result grouping.',
  `u_track_view` tinyint(1) DEFAULT NULL COMMENT 'User can change track result view.',
  `u_browse_show` tinyint(1) DEFAULT NULL COMMENT 'User can change metabrowser visibility.',
  `u_browse_columns` tinyint(1) DEFAULT NULL COMMENT 'User can change metabrowser columns.',
  `u_project_show` tinyint(1) DEFAULT NULL COMMENT 'User can change project panel visibility.',
  `u_project_width` tinyint(1) DEFAULT NULL COMMENT 'User can change project panel width.',
  `u_download_zip` tinyint(1) DEFAULT NULL COMMENT 'User can change download method setting.',
  `u_download_flatten` tinyint(1) DEFAULT NULL COMMENT 'User can change download flat setting.',
  `u_wdgts` tinyint(1) DEFAULT NULL COMMENT 'User can change widgets structure.',
  `u_emailable` tinyint(1) DEFAULT NULL COMMENT 'User email playlists.',
  `u_home` tinyint(1) DEFAULT NULL COMMENT 'User can see home screen.',
  `s_sort_tracks` longtext COMMENT 'Sort order of track results.',
  `s_sort_albums` longtext COMMENT 'Sort order of album results.',
  `s_src_type` enum('db','special','folder','playlist','smart','cuesheet') DEFAULT NULL COMMENT 'Source type.',
  `s_src_id` int(11) DEFAULT NULL COMMENT 'Source ID: 0: all, >0:  db_id, <0: -folder_id',
  `s_result_vista` enum('albums','mixed','tracks') DEFAULT NULL COMMENT 'Results layout.',
  `s_result_nondown` tinyint(1) DEFAULT NULL COMMENT 'Hide non-downloadable results.',
  `s_track_columns` text COMMENT 'Track result columns.',
  `s_track_order` varchar(255) DEFAULT NULL COMMENT 'Track result order.',
  `s_track_limit` int(11) DEFAULT NULL COMMENT 'Track result page limit.',
  `s_track_grouping` enum('off','on') DEFAULT NULL COMMENT 'Track result grouping.',
  `s_track_view` enum('auto','fixed') DEFAULT NULL COMMENT 'Track result view.',
  `s_browse_show` enum('hide','show') DEFAULT NULL COMMENT 'Metabrowser visibility.',
  `s_browse_columns` text COMMENT 'Metabrowser columns.',
  `s_project_show` enum('hide','show') DEFAULT NULL COMMENT 'Project panel visibility.',
  `s_project_width` int(11) DEFAULT NULL COMMENT 'Project panel width.',
  `s_project_exts` tinyint(1) DEFAULT NULL COMMENT 'Show file extensions in project track names.',
  `s_download_zip` enum('never','folders','multiple','always','push') DEFAULT NULL COMMENT 'Zip up multiple track downloads into a single zip file.',
  `s_download_flatten` tinyint(1) DEFAULT NULL COMMENT 'Flatten folder downloads by collapsing the folder structure.',
  `s_wdgts` text COMMENT 'Widgets structure.',
  `hash` text,
  `orig_id` int(10) unsigned DEFAULT NULL COMMENT 'Transiet field used when doing complex copy operations.',
  `s_static_options` text,
  `s_panel_selected` tinyint(1) DEFAULT '0',
  `s_selective_show` tinyint(1) DEFAULT '0',
  `u_selective_show` tinyint(1) DEFAULT '0',
  `s_topics_show` enum('hide','show') DEFAULT 'hide',
  `u_topics_show` enum('hide','show') DEFAULT 'hide',
  `p_times` varchar(25) DEFAULT NULL,
  `u_continuous_show` enum('on','off') DEFAULT 'on',
  `s_continuous_show` enum('on','off') DEFAULT 'on',
  `u_panel_selected` int(11) DEFAULT '0',
  `u_static_options` text,
  `s_topics_show_details` text,
  `u_topics_show_details` text,
  `s_set_topics_sections` text,
  `u_set_topics_sections` text,
  `p_admin_download_xml` tinyint(4) DEFAULT NULL,
  `thesaurus_status` tinyint(1) DEFAULT NULL,
  `p_globalcomment` enum('yes','no') DEFAULT NULL,
  `s_enable_licensing` tinyint(1) DEFAULT NULL,
  `s_download_format` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=71 DEFAULT CHARSET=utf8;

--
-- Table structure for table `share`
--

CREATE TABLE `share` (
  `name` varchar(255) NOT NULL COMMENT 'Unique shared memory key.',
  `value` varchar(20000) NOT NULL DEFAULT '' COMMENT 'Shared memory value.',
  PRIMARY KEY (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='InnoDB, row locking, shared memory and semaphore table.';

--
-- Table structure for table `shared`
--

CREATE TABLE `shared` (
  `user_id` int(11) NOT NULL COMMENT 'Viewing user ID.',
  `owner_id` int(11) NOT NULL COMMENT 'Sharing user ID.'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Links users to other user''s shared folders.';

--
-- Table structure for table `site`
--

CREATE TABLE `site` (
  `site_title` varchar(255) NOT NULL COMMENT '<title></title>',
  `site_description` text NOT NULL COMMENT '<meta name="description" content="" />',
  `site_keywords` text NOT NULL COMMENT '<meta name="keywords" content="" />',
  `name_project` varchar(30) NOT NULL DEFAULT '',
  `name_folder` varchar(20) NOT NULL DEFAULT '',
  `name_spot` varchar(20) NOT NULL DEFAULT '',
  `name_track` varchar(20) NOT NULL DEFAULT '',
  `email_type` varchar(10) NOT NULL DEFAULT 'smtp',
  `email_from` varchar(255) DEFAULT NULL,
  `email_name` varchar(255) DEFAULT NULL,
  `email_sender` varchar(255) DEFAULT NULL,
  `email_usender` varchar(255) DEFAULT NULL,
  `email_host` varchar(255) DEFAULT NULL,
  `email_username` varchar(255) DEFAULT NULL,
  `email_password` varchar(255) DEFAULT NULL,
  `login_guest` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `login_remember` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `albuming` varchar(255) DEFAULT NULL,
  `grouping` varchar(255) DEFAULT NULL,
  `home_url` text,
  `home_skip` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Skip Home Screen on login.',
  `metadata_order` varchar(5000) NOT NULL DEFAULT '["Filename","TrackTitle","CDTitle","Library","Database","Category","Composer","Publisher","Time","Description"]',
  `album_volume` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Display Volume field under album covers.',
  `css_enabled` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Flag to enable custom CSS stylesheets.',
  `date_full` varchar(32) NOT NULL COMMENT 'Full date format using PHP date format string.',
  `date_long` varchar(32) NOT NULL COMMENT 'Long date format using PHP date format string.',
  `date_medium` varchar(32) NOT NULL COMMENT 'Medium date format using PHP date format string.',
  `date_short` varchar(32) NOT NULL COMMENT 'Short date format using PHP date format string.',
  `player` enum('html5','html5fullAltOne','flashV2','flashV3','waveformPlayer','flash','quicktime','universal','qtSimple','flowPlayer','flashMp3Player','xspfPlayerSlim','originalSingle','jwPlayer','resizableMp3Player','html5full') DEFAULT NULL,
  `registration` enum('none','instant','email','alert') NOT NULL DEFAULT 'none' COMMENT 'Auto registration options.',
  `registration_alert` text,
  `registration_email` text NOT NULL COMMENT 'Json structure for the email to send new registering users.',
  `registration_fields` text NOT NULL COMMENT 'Json array of fields to include in the registration form.',
  `registration_company` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Company field is required for registration.',
  `hash` text NOT NULL COMMENT 'Miscellaneous settings stored in a free-form JSON hash.',
  `login_head` text NOT NULL COMMENT 'Custom HTML to insert at end of <head></head>.',
  `login_body1` text NOT NULL COMMENT 'Custom HTML to insert at start of <body></body>.',
  `login_body2` text NOT NULL COMMENT 'Custom HTML to insert at end of <body></body>.',
  `main_head` text NOT NULL COMMENT 'Custom HTML to insert at end of <head></head>.',
  `main_body1` text NOT NULL COMMENT 'Custom HTML to insert at start of <body></body>.',
  `main_body2` text NOT NULL COMMENT 'Custom HTML to insert at end of <body></body>.',
  `admin_head` text NOT NULL COMMENT 'Custom HTML to insert at end of <head></head>.',
  `admin_body1` text NOT NULL COMMENT 'Custom HTML to insert at start of <body></body>.',
  `admin_body2` text NOT NULL COMMENT 'Custom HTML to insert at end of <body></body>.',
  `cue_columns` text NOT NULL COMMENT 'Json array of columns to include in cuesheets.',
  `cue_pdf` enum('table','vertical') NOT NULL DEFAULT 'table' COMMENT 'Cuesheet PDF report format.',
  `cue_renames` text NOT NULL COMMENT 'Cuesheet field rename mapping.',
  `cue_top` float NOT NULL COMMENT 'Cuesheet PDF top margin in mm.',
  `cue_bottom` float NOT NULL COMMENT 'Cuesheet PDF bottom margin in mm.',
  `cue_left` float NOT NULL COMMENT 'Cuesheet PDF left margin in mm.',
  `cue_right` float NOT NULL COMMENT 'Cuesheet PDF right margin in mm.',
  `cue_header` float NOT NULL COMMENT 'Cuesheet PDF header offset in mm.',
  `cue_footer` float NOT NULL COMMENT 'Cuesheet PDF footer offset in mm.',
  `cue_orientation` enum('portrait','landscape') NOT NULL DEFAULT 'portrait' COMMENT 'Cuesheet PDF orientation.',
  `down_push` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Enable server-side share option.',
  `down_push_path` varchar(255) NOT NULL DEFAULT '' COMMENT 'Server-side share path.',
  `all_sources` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Enable All Sources search option.',
  `reset_sort` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Reset user''s sort order on new search.',
  `suggest` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Enable Search Suggest.',
  `help_url` text NOT NULL COMMENT 'URL to client supplied help page.',
  `lic_id` varchar(40) NOT NULL COMMENT 'License ID.',
  `lic_data` text NOT NULL COMMENT 'License data.',
  `lic_key` text NOT NULL,
  `user_username_change` tinyint(4) DEFAULT NULL,
  `site_template` varchar(25) DEFAULT NULL,
  `cue_col_details` varchar(500) DEFAULT NULL,
  `reg_emails` text,
  `password_length` tinyint(4) DEFAULT NULL,
  `password_complexity` tinyint(4) DEFAULT '0',
  `static_search_enabled` tinyint(1) DEFAULT '1',
  `catalogue_search_enabled` tinyint(1) DEFAULT '1',
  `leftpanel_title` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Site-wide settings';

--
-- Table structure for table `smdl`
--

CREATE TABLE `smdl` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `payload` longtext NOT NULL,
  `expiration` int(11) NOT NULL,
  `pkg_id` char(16) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;

--
-- Table structure for table `smdl_presets`
--

CREATE TABLE `smdl_presets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `user_id` int(11) NOT NULL,
  `settings_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `soundmouse_export`
--

CREATE TABLE `soundmouse_export` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `data` text NOT NULL,
  `time` datetime NOT NULL,
  `status` int(11) NOT NULL,
  `is_running` int(11) NOT NULL,
  `filename` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;

--
-- Table structure for table `static_search_options`
--

CREATE TABLE `static_search_options` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `search_criteria` varchar(1000) DEFAULT NULL,
  `description` varchar(1000) NOT NULL,
  `category` varchar(25) DEFAULT NULL,
  `sequence` int(11) DEFAULT NULL,
  `tab_id` int(11) DEFAULT NULL,
  `widgets_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `category` (`category`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

--
-- Table structure for table `static_search_tabs`
--

CREATE TABLE `static_search_tabs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date_created` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `name` varchar(50) NOT NULL,
  `sequence` float DEFAULT NULL,
  `widgets_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

--
-- Table structure for table `suggest`
--

CREATE TABLE `suggest` (
  `suggest` varchar(128) NOT NULL,
  `src` int(11) NOT NULL,
  `key` varchar(128) NOT NULL,
  `ndx` int(11) NOT NULL,
  `sort` double NOT NULL,
  KEY `search` (`sort`,`src`,`key`,`suggest`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `tracks`
--

CREATE TABLE `tracks` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Primary key.',
  `root_id` int(11) NOT NULL COMMENT 'Root folder with owner and access settings.',
  `playlist_id` int(11) NOT NULL DEFAULT '0' COMMENT 'Parent playlist containing this track. NULL = deleted.',
  `path` varchar(1000) DEFAULT '' COMMENT 'Tree hierachy path. empty = deleted.',
  `asset_id` int(11) NOT NULL COMMENT 'Entry in `assets` table that represents this track.',
  `db_id` int(11) DEFAULT NULL,
  `track_id` int(11) DEFAULT NULL,
  `ndx` int(11) NOT NULL COMMENT 'The sequence index of this track within the playlist.',
  `usage` varchar(32) NOT NULL COMMENT 'Standardized code indicating how the track was used.',
  `time` time NOT NULL COMMENT 'Duration of song usage within the work.',
  `created` datetime NOT NULL COMMENT 'Timestamp of the original creation of row.',
  `updated` datetime NOT NULL COMMENT 'Timestamp of the last modification of row.',
  `deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Deleted flag.',
  `updated_by` int(11) NOT NULL DEFAULT '0' COMMENT 'User ID of user making the last modification of row.',
  `orig_id` int(11) DEFAULT NULL COMMENT 'Transient field used when doing complex copy operations.',
  `CueInTime` varchar(30) DEFAULT NULL,
  `CueOutTime` varchar(30) DEFAULT NULL,
  `CueTime` varchar(30) DEFAULT NULL,
  `CuePublisher` text,
  `CueComposer` text,
  `CueUsage` varchar(250) DEFAULT NULL,
  `CueUpLoaded` int(5) DEFAULT NULL,
  `track_comments` text,
  `CueTitle` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `asset_index` (`asset_id`),
  KEY `path_index` (`path`(333)),
  KEY `orig_id_index` (`orig_id`),
  KEY `playlist_index` (`playlist_id`),
  KEY `db_index` (`db_id`),
  KEY `track_id_x1` (`track_id`),
  KEY `ndx` (`ndx`)
) ENGINE=MyISAM AUTO_INCREMENT=320 DEFAULT CHARSET=utf8;

--
-- Table structure for table `usercomment_comments`
--

CREATE TABLE `usercomment_comments` (
  `user_id` int(11) NOT NULL,
  `db_id` int(11) NOT NULL,
  `metadata_id` bigint(20) NOT NULL,
  `comment` text NOT NULL,
  UNIQUE KEY `unique_index` (`user_id`,`db_id`,`metadata_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `key` char(40) NOT NULL COMMENT 'Private random sha1 string per user for security.',
  `type` enum('system','template','user') NOT NULL DEFAULT 'user',
  `deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Flag - user account has been deleted.',
  `enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Flag - user account is enabled.',
  `expires` date DEFAULT NULL COMMENT 'Date account expires and becomes disabled. NULL = never.',
  `registering` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Flag - user is in the process of registering.',
  `group_id` int(11) DEFAULT NULL,
  `role_id` int(11) DEFAULT NULL,
  `settings_id` int(11) NOT NULL COMMENT 'User''s settings.',
  `folder_id` int(11) NOT NULL COMMENT 'Root folder of user''s personal project content.',
  `user` varchar(255) CHARACTER SET latin1 NOT NULL DEFAULT '',
  `username` varchar(255) CHARACTER SET latin1 NOT NULL DEFAULT '',
  `password` varchar(32) CHARACTER SET latin1 NOT NULL DEFAULT '',
  `reset_hash` varchar(32) CHARACTER SET latin1 DEFAULT NULL,
  `reset_password` varchar(32) CHARACTER SET latin1 DEFAULT NULL,
  `email` varchar(255) CHARACTER SET latin1 NOT NULL DEFAULT '',
  `company` varchar(128) NOT NULL COMMENT 'Company user works for.',
  `phone` varchar(32) NOT NULL COMMENT 'Phone number.',
  `rep` varchar(128) NOT NULL COMMENT 'Sales representative.',
  `country_iso` varchar(3) DEFAULT NULL,
  `player` enum('html5','html5fullAltOne','flashV2','flashV3','waveformPlayer','flash','quicktime','universal','qtSimple','flowPlayer','flashMp3Player','xspfPlayerSlim','originalSingle','jwPlayer','resizableMp3Player','html5full') DEFAULT NULL,
  `is_public` tinyint(4) DEFAULT '0',
  `address1` varchar(100) DEFAULT NULL,
  `address2` varchar(100) DEFAULT NULL,
  `city` varchar(50) DEFAULT NULL,
  `region` varchar(50) DEFAULT NULL,
  `postal_code` varchar(30) DEFAULT NULL,
  `phone_fax` varchar(32) DEFAULT NULL,
  `phone_cell` varchar(32) DEFAULT NULL,
  `contract_owner` varchar(50) DEFAULT NULL,
  `contract_type` varchar(50) DEFAULT NULL,
  `related_contact_id` varchar(25) DEFAULT NULL,
  `original_cuegle_id` int(4) DEFAULT NULL,
  `business_type` varchar(25) DEFAULT NULL,
  `first_name` varchar(50) DEFAULT NULL,
  `last_name` varchar(50) DEFAULT NULL,
  `notes` text,
  `date_registered` datetime DEFAULT NULL,
  `original_external_imported_id` int(4) DEFAULT NULL,
  `job_title` varchar(50) DEFAULT NULL,
  `sales_person` tinyint(1) DEFAULT NULL,
  `rep_selected` int(4) DEFAULT NULL,
  `country_text` varchar(100) DEFAULT NULL,
  `pmd_contact_name` varchar(255) DEFAULT NULL,
  `show_title` varchar(255) DEFAULT NULL,
  `network` varchar(255) DEFAULT NULL,
  `platform` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `folder_index` (`folder_id`,`id`),
  KEY `group_id` (`group_id`),
  KEY `role_id` (`role_id`),
  KEY `settings_id` (`settings_id`),
  KEY `folder_id` (`folder_id`),
  KEY `enabled` (`enabled`),
  KEY `is_public` (`is_public`),
  KEY `username_index` (`username`,`password`),
  KEY `country_text` (`country_text`)
) ENGINE=MyISAM AUTO_INCREMENT=53 DEFAULT CHARSET=utf8;

--
-- Table structure for table `users_groups`
--

CREATE TABLE `users_groups` (
  `user_id` int(11) NOT NULL COMMENT 'User ID.',
  `group_id` int(11) NOT NULL COMMENT 'Group ID.',
  `role_id` int(11) DEFAULT NULL COMMENT 'User''s role within the group.',
  PRIMARY KEY (`user_id`,`group_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `widgets`
--

CREATE TABLE `widgets` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `key_code` varchar(50) NOT NULL,
  `json` text,
  `active` int(10) unsigned DEFAULT '1',
  `title` varchar(50) DEFAULT NULL,
  `widgets_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `key_code` (`key_code`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;

--
-- Table structure for table `widgets_roles`
--

CREATE TABLE `widgets_roles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date_created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `widgets_id` int(11) NOT NULL,
  `role_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


