# ************************************************************
# Sequel Pro SQL dump
# Version 4096
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: localhost (MySQL 5.5.38)
# Database: mm_install_test_admin
# Generation Time: 2015-06-15 23:01:01 +0000
# ************************************************************





# Dump of 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 DEFAULT CHARSET=utf8 COMMENT='Logs details about client browsers.';



# Dump of 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.',
  `meta_browse_fields` text,
  `split_text` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Mapping of user columns to database columns.';


INSERT INTO `columns` (`id`, `display`, `active`, `browse`, `context`, `link`, `meta_browse_fields`, `split_text`)
VALUES
	('Database','Database',1,1,'metadata','field',NULL,''),
	('Relevance','Relevance',1,0,'metadata',NULL,NULL,''),
	('RecID','RecID',1,0,'metadata','field',NULL,''),
	('Filename','Filename',1,0,'metadata','field',NULL,''),
	('Pathname','Pathname',1,0,'metadata','field',NULL,''),
	('FilePath','FilePath',1,0,'metadata','field',NULL,''),
	('Description','Description',1,0,'metadata','word',NULL,''),
	('Source','Source',1,0,'metadata','field',NULL,''),
	('Duration','Duration',1,1,'metadata','field',NULL,''),
	('Category','Category 2',1,1,'metadata','field',NULL,''),
	('SubCategory','SubCategory',1,0,'metadata','field',NULL,''),
	('_FlatCategory','_FlatCategory',0,0,'metadata','field',NULL,''),
	('Manufacturer','Manufacturer',1,0,'metadata','field',NULL,''),
	('Designer','Designer',1,0,'metadata','field',NULL,''),
	('Show','Show',1,0,'metadata','field',NULL,''),
	('Library','Library',1,1,'metadata','field',NULL,''),
	('Notes','Notes',1,0,'metadata','field',NULL,''),
	('RecType','RecType',1,0,'metadata','field',NULL,''),
	('ShortID','ShortID',1,0,'metadata','field',NULL,''),
	('LongID','LongID',1,0,'metadata','field',NULL,''),
	('RecMedium','RecMedium',1,0,'metadata','field',NULL,''),
	('Rating','Rating',1,0,'metadata','field',NULL,''),
	('Location','Location',1,0,'metadata','field',NULL,''),
	('Microphone','Microphone',1,0,'metadata','field',NULL,''),
	('Keywords','Keywords',1,0,'metadata','word',NULL,''),
	('Composer','Composer',1,1,'metadata','field',NULL,''),
	('Publisher','Publisher',1,1,'metadata','field',NULL,''),
	('Performer','Performer',1,0,'metadata','field',NULL,''),
	('Arranger','Arranger',1,0,'metadata','field',NULL,''),
	('Conductor','Conductor',1,0,'metadata','field',NULL,''),
	('TrackTitle','TrackTitle',1,0,'metadata','field',NULL,''),
	('CDTitle','Album',1,1,'metadata','field',NULL,''),
	('CDDescription','CDDescription',1,0,'metadata','word',NULL,''),
	('FeaturedInstrument','Featured Instrument',1,0,'metadata','field',NULL,''),
	('Scene','Scene',1,0,'metadata','field',NULL,''),
	('Take','Take',1,0,'metadata','field',NULL,''),
	('Tape','Tape',1,0,'metadata','field',NULL,''),
	('FileType','FileType',1,0,'metadata','field',NULL,''),
	('CreationDate','CreationDate',1,0,'metadata','field',NULL,''),
	('ModificationDate','ModificationDate',1,0,'metadata','field',NULL,''),
	('TotalFrames','TotalFrames',1,0,'metadata','field',NULL,''),
	('EntryDate','EntryDate',1,0,'metadata','field',NULL,''),
	('Popularity','Popularity',1,0,'metadata','field',NULL,''),
	('Split','Split',1,0,'metadata','field',NULL,''),
	('SplitChannels','SplitChannels',1,0,'metadata','field',NULL,NULL),
	('SampleRate','SampleRate',1,0,'metadata','field',NULL,''),
	('Channels','Channels',1,0,'metadata','field',NULL,''),
	('_WaveformLink','_WaveformLink',0,0,'metadata',NULL,NULL,''),
	('_PictureLink','_PictureLink',0,0,'metadata',NULL,NULL,''),
	('_UMID','_UMID',0,0,'metadata',NULL,NULL,''),
	('BitDepth','BitDepth',1,0,'metadata','field',NULL,''),
	('ChannelLayout','ChannelLayout',1,0,'metadata','field',NULL,''),
	('_Duration','_Duration',0,0,'metadata','field',NULL,NULL),
	('BPM','BPM',1,0,'metadata','field',NULL,''),
	('Key','Key',1,0,'metadata','field',NULL,''),
	('BWDescription','BWDescription',0,0,'metadata','word',NULL,''),
	('BWOriginator','BWOriginator',0,0,'metadata','field',NULL,''),
	('BWOriginatorRef','BWOriginatorRef',1,0,'metadata','field',NULL,''),
	('FXName','FXName',0,0,'metadata','field',NULL,''),
	('Time','Time',1,1,'metadata','field',NULL,''),
	('Volume','Volume',1,1,'metadata','field',NULL,''),
	('Track','Track',1,0,'metadata','field',NULL,''),
	('Index','Index',1,0,'metadata','field',NULL,''),
	('Artwork','Artwork',1,0,'metadata',NULL,NULL,''),
	('Waveform','Waveform',1,0,'metadata',NULL,NULL,''),
	('CueNo','Cue #',1,0,'cuesheet',NULL,NULL,''),
	('CueUsage','Usage',1,0,'cuesheet',NULL,NULL,''),
	('CueTime','CueTime',1,0,'cuesheet',NULL,NULL,''),
	('DateAddedToSystem','Date Added',1,1,'metadata','field',NULL,''),
	('ReleaseDate','ReleaseDate',1,0,'metadata','field',NULL,''),
	('ScannedDate','ScannedDate',0,0,'metadata','field',NULL,''),
	('TouchedDate','TouchedDate',0,0,'metadata','field',NULL,''),
	('_Dirty','_Dirty',0,0,'metadata','field',NULL,''),
	('_smint_track_id','_smint_track_id',0,0,'metadata','field',NULL,''),
	('Artist','Artist',0,0,'metadata','field',NULL,''),
	('Tempo','Tempo',0,0,'metadata','field',NULL,''),
	('URL','URL',0,0,'metadata','field',NULL,''),
	('Mood','Mood',0,0,'metadata','field',NULL,''),
	('Usage','Usage',0,0,'metadata','field',NULL,''),
	('Version','Version',0,0,'metadata','field',NULL,''),
	('TrackYear','TrackYear',0,0,'metadata','field',NULL,''),
	('UserComments','UserComments',0,0,'metadata','field',NULL,''),
	('Lyrics','Lyrics',1,0,'metadata','word',NULL,''),
	('BWTimeStamp','BWTimeStamp',0,0,'metadata','field',NULL,''),
	('BWTime','BWTime',0,0,'metadata','field',NULL,''),
	('BWDate','BWDate',0,0,'metadata','field',NULL,''),
	('Playlist','Playlist',1,1,'metadata','field',NULL,''),
	('smint_track_id','smint_track_id',0,1,'metadata','word',NULL,''),
	('spectral_external_key','spectral_external_key',0,1,'metadata','word',NULL,''),
	('JDNotes','JDNotes',0,0,'metadata','field',NULL,''),
	('NewSource','NewSource',0,0,'metadata','field',NULL,''),
	('cdndate','cdndate',0,0,'metadata','field',NULL,''),
	('cdnstale','cdnstale',0,0,'metadata','field',NULL,''),
	('CueInTime','CueInTime',1,0,'cuesheet','field',NULL,''),
	('CueOutTime','CueOutTime',1,0,'cuesheet','field',NULL,''),
	('ISRC','ISRC',1,0,'metadata','field',NULL,''),
	('_PathnameLink','_PathnameLink',0,0,'metadata','field',NULL,''),
	('_CategoryLink','_CategoryLink',0,0,'metadata','field',NULL,''),
	('_ManufacturerLink','_ManufacturerLink',0,0,'metadata','field',NULL,''),
	('_LibraryLink','_LibraryLink',0,0,'metadata','field',NULL,''),
	('_DesignerLink','_DesignerLink',0,0,'metadata','field',NULL,''),
	('_CDTitleLink','_CDTitleLink',0,0,'metadata','field',NULL,''),
	('_ComposerLink','_ComposerLink',0,0,'metadata','field',NULL,''),
	('_FeaturedInstrumentLink','_FeaturedInstrumentLink',0,0,'metadata','field',NULL,''),
	('_BPMLink','_BPMLink',0,0,'metadata','field',NULL,''),
	('_VolumeLink','_VolumeLink',0,0,'metadata','field',NULL,''),
	('_ShowLink','_ShowLink',0,0,'metadata','field',NULL,''),
	('_SceneLink','_SceneLink',0,0,'metadata','field',NULL,''),
	('_TapeLink','_TapeLink',0,0,'metadata','field',NULL,''),
	('_ShortIDLink','_ShortIDLink',0,0,'metadata','field',NULL,''),
	('_MoodLink','_MoodLink',0,0,'metadata','field',NULL,''),
	('_UsageLink','_UsageLink',0,0,'metadata','field',NULL,''),
	('_FilePathHash','_FilePathHash',0,0,'metadata','field',NULL,''),
	('_PublisherLink','_PublisherLink',0,0,'metadata','field',NULL,''),
	('Vocal','Vocal',0,0,'metadata','field',NULL,'');



# Dump of 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,
  PRIMARY KEY (`id`),
  KEY `cart_id` (`cart_id`),
  KEY `track_id` (`track_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;



# Dump of 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,
  PRIMARY KEY (`id`),
  KEY `users_id` (`users_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;



# Dump of 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=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;



# Dump of 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`),
  KEY `index_markets_on_position` (`position`),
  KEY `index_markets_on_country_code_and_region_code` (`country_code`,`region_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;



# Dump of 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,
  PRIMARY KEY (`id`),
  KEY `cart_id` (`order_id`),
  KEY `track_id` (`track_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;



# Dump of table comm_payment_methods
# ------------------------------------------------------------

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



# Dump of table comm_payments
# ------------------------------------------------------------

CREATE TABLE `comm_payments` (
  `id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;



# Dump of 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=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;



# Dump of 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=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;



# Dump of 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=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;



# Dump of 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=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;



# Dump of 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=InnoDB DEFAULT CHARSET=latin1;



# Dump of 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=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;



# Dump of 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,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_countries_iso` (`iso`),
  KEY `country_name` (`country_name`),
  KEY `custom_order` (`custom_order`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


INSERT INTO `countries` (`id`, `iso`, `country_name`, `custom_order`, `iso_two_chars`)
VALUES
	(65,'abw','Aruba',NULL,'aw'),
	(66,'afg','Afghanistan',NULL,'af'),
	(67,'ago','Angola',NULL,'ao'),
	(68,'aia','Anguilla',NULL,'ai'),
	(69,'ala','Aaland Islands',NULL,'ax'),
	(70,'alb','Albania',NULL,'al'),
	(71,'and','Andorra',NULL,'ad'),
	(72,'ant','Netherlands Antilles',NULL,NULL),
	(73,'are','United Arab Emirates',NULL,'ae'),
	(74,'arg','Argentina',NULL,'ar'),
	(75,'arm','Armenia',NULL,'am'),
	(76,'asm','American Samoa',NULL,'as'),
	(77,'ata','Antarctica',NULL,'aq'),
	(78,'atf','French Southern Territories',NULL,'tf'),
	(79,'atg','Antigua and Barbuda',NULL,'ag'),
	(80,'aus','Australia',NULL,'au'),
	(81,'aut','Austria',NULL,'at'),
	(82,'aze','Azerbaijan',NULL,'az'),
	(83,'bdi','Burundi',NULL,'bi'),
	(84,'bel','Belgium',NULL,'be'),
	(85,'ben','Benin',NULL,'bj'),
	(86,'bfa','Burkina Faso',NULL,'bf'),
	(87,'bgd','Bangladesh',NULL,'bd'),
	(88,'bgr','Bulgaria',NULL,'bg'),
	(89,'bhr','Bahrain',NULL,'bh'),
	(90,'bhs','Bahamas',NULL,'bs'),
	(91,'bih','Bosnia and Herzegovina',NULL,'ba'),
	(92,'blm','Saint Barthelemy',NULL,'bl'),
	(93,'blr','Belarus',NULL,'by'),
	(94,'blz','Belize',NULL,'bz'),
	(95,'bmu','Bermuda',NULL,'bm'),
	(96,'bol','Bolivia, Plurinational State of',NULL,'bo'),
	(97,'bra','Brazil',NULL,'br'),
	(98,'brb','Barbados',NULL,'bb'),
	(99,'brn','Brunei Darussalam',NULL,'bn'),
	(100,'btn','Bhutan',NULL,'bt'),
	(101,'bvt','Bouvet Island',NULL,'bv'),
	(102,'bwa','Botswana',NULL,'bw'),
	(103,'caf','Central African Republic',NULL,'cf'),
	(104,'can','Canada',NULL,'ca'),
	(105,'cck','Cocos (Keeling) Islands',NULL,'cc'),
	(106,'che','Switzerland',NULL,'ch'),
	(107,'chl','Chile',NULL,'cl'),
	(108,'chn','China',NULL,'cn'),
	(109,'civ','Côte d\'Ivoire',NULL,'ci'),
	(110,'cmr','Cameroon',NULL,'cm'),
	(111,'cod','Congo, the Democratic Republic of the',NULL,'cd'),
	(112,'cog','Congo',NULL,'cg'),
	(113,'cok','Cook Islands',NULL,'ck'),
	(114,'col','Colombia',NULL,'co'),
	(115,'com','Comoros',NULL,'km'),
	(116,'cpv','Cape Verde',NULL,'cv'),
	(117,'cri','Costa Rica',NULL,'cr'),
	(118,'cub','Cuba',NULL,'cu'),
	(119,'cxr','Christmas Island',NULL,'cx'),
	(120,'cym','Cayman Islands',NULL,'ky'),
	(121,'cyp','Cyprus',NULL,'cy'),
	(122,'cze','Czech Republic',NULL,'cz'),
	(123,'deu','Germany',NULL,'de'),
	(124,'dji','Djibouti',NULL,'dj'),
	(125,'dma','Dominica',NULL,'dm'),
	(126,'dnk','Denmark',NULL,'dk'),
	(127,'dom','Dominican Republic',NULL,'do'),
	(128,'dza','Algeria',NULL,'dz'),
	(129,'ecu','Ecuador',NULL,'ec'),
	(130,'egy','Egypt',NULL,'eg'),
	(131,'eri','Eritrea',NULL,'er'),
	(132,'esh','Western Sahara',NULL,'eh'),
	(133,'esp','Spain',NULL,'es'),
	(134,'est','Estonia',NULL,'ee'),
	(135,'eth','Ethiopia',NULL,'et'),
	(136,'fin','Finland',NULL,'fi'),
	(137,'fji','Fiji',NULL,'fj'),
	(138,'flk','Falkland Islands (Malvinas)',NULL,'fk'),
	(139,'fra','France',NULL,'fr'),
	(140,'fro','Faroe Islands',NULL,'fo'),
	(141,'fsm','Micronesia, Federated States of',NULL,'fm'),
	(142,'gab','Gabon',NULL,'ga'),
	(143,'gbr','United Kingdom',2,'gb'),
	(144,'geo','Georgia',NULL,'ge'),
	(145,'ggy','Guernsey',NULL,'gg'),
	(146,'gha','Ghana',NULL,'gh'),
	(147,'gib','Gibraltar',NULL,'gi'),
	(148,'gin','Guinea',NULL,'gn'),
	(149,'glp','Guadeloupe',NULL,'gp'),
	(150,'gmb','Gambia',NULL,'gm'),
	(151,'gnb','Guinea-Bissau',NULL,'gw'),
	(152,'gnq','Equatorial Guinea',NULL,'gq'),
	(153,'grc','Greece',NULL,'gr'),
	(154,'grd','Grenada',NULL,'gd'),
	(155,'grl','Greenland',NULL,'gl'),
	(156,'gtm','Guatemala',NULL,'gt'),
	(157,'guf','French Guiana',NULL,'gf'),
	(158,'gum','Guam',NULL,'gu'),
	(159,'guy','Guyana',NULL,'gy'),
	(160,'hkg','Hong Kong',NULL,'hk'),
	(161,'hmd','Heard Island and McDonald Islands',NULL,'hm'),
	(162,'hnd','Honduras',NULL,'hn'),
	(163,'hrv','Croatia',NULL,'hr'),
	(164,'hti','Haiti',NULL,'ht'),
	(165,'hun','Hungary',NULL,'hu'),
	(166,'idn','Indonesia',NULL,'id'),
	(167,'imn','Isle of Man',NULL,'im'),
	(168,'ind','India',NULL,'in'),
	(169,'iot','British Indian Ocean Territory',NULL,'io'),
	(170,'irl','Ireland',NULL,'ie'),
	(171,'irn','Iran, Islamic Republic of',NULL,'ir'),
	(172,'irq','Iraq',NULL,'iq'),
	(173,'isl','Iceland',NULL,'is'),
	(174,'isr','Israel',NULL,'il'),
	(175,'ita','Italy',NULL,'it'),
	(176,'jam','Jamaica',NULL,'jm'),
	(177,'jey','Jersey',NULL,'je'),
	(178,'jor','Jordan',NULL,'jo'),
	(179,'jpn','Japan',NULL,'jp'),
	(180,'kaz','Kazakhstan',NULL,'kz'),
	(181,'ken','Kenya',NULL,'ke'),
	(182,'kgz','Kyrgyzstan',NULL,'kg'),
	(183,'khm','Cambodia',NULL,'kh'),
	(184,'kir','Kiribati',NULL,'ki'),
	(185,'kna','Saint Kitts and Nevis',NULL,'kn'),
	(186,'kor','Korea, Republic of',NULL,'kr'),
	(187,'kwt','Kuwait',NULL,'kw'),
	(188,'lao','Lao People\'s Democratic Republic',NULL,'la'),
	(189,'lbn','Lebanon',NULL,'lb'),
	(190,'lbr','Liberia',NULL,'lr'),
	(191,'lby','Libyan Arab Jamahiriya',NULL,'ly'),
	(192,'lca','Saint Lucia',NULL,'lc'),
	(193,'lie','Liechtenstein',NULL,'li'),
	(194,'lka','Sri Lanka',NULL,'lk'),
	(195,'lso','Lesotho',NULL,'ls'),
	(196,'ltu','Lithuania',NULL,'lt'),
	(197,'lux','Luxembourg',NULL,'lu'),
	(198,'lva','Latvia',NULL,'lv'),
	(199,'mac','Macao',NULL,'mo'),
	(200,'maf','Saint Martin (French part)',NULL,'mf'),
	(201,'mar','Morocco',NULL,'ma'),
	(202,'mco','Monaco',NULL,'mc'),
	(203,'mda','Moldova, Republic of',NULL,'md'),
	(204,'mdg','Madagascar',NULL,'mg'),
	(205,'mdv','Maldives',NULL,'mv'),
	(206,'mex','Mexico',NULL,'mx'),
	(207,'mhl','Marshall Islands',NULL,'mh'),
	(208,'mkd','Macedonia, the former Yugoslav Republic of',NULL,'mk'),
	(209,'mli','Mali',NULL,'ml'),
	(210,'mlt','Malta',NULL,'mt'),
	(211,'mmr','Myanmar',NULL,'mm'),
	(212,'mne','Montenegro',NULL,'me'),
	(213,'mng','Mongolia',NULL,'mn'),
	(214,'mnp','Northern Mariana Islands',NULL,'mp'),
	(215,'moz','Mozambique',NULL,'mz'),
	(216,'mrt','Mauritania',NULL,'mr'),
	(217,'msr','Montserrat',NULL,'ms'),
	(218,'mtq','Martinique',NULL,'mq'),
	(219,'mus','Mauritius',NULL,'mu'),
	(220,'mwi','Malawi',NULL,'mw'),
	(221,'mys','Malaysia',NULL,'my'),
	(222,'myt','Mayotte',NULL,'yt'),
	(223,'nam','Namibia',NULL,'na'),
	(224,'ncl','New Caledonia',NULL,'nc'),
	(225,'ner','Niger',NULL,'ne'),
	(226,'nfk','Norfolk Island',NULL,'nf'),
	(227,'nga','Nigeria',NULL,'ng'),
	(228,'nic','Nicaragua',NULL,'ni'),
	(229,'niu','Niue',NULL,'nu'),
	(230,'nld','Netherlands',NULL,'nl'),
	(231,'nor','Norway',NULL,'no'),
	(232,'npl','Nepal',NULL,'np'),
	(233,'nru','Nauru',NULL,'nr'),
	(234,'nzl','New Zealand',NULL,'nz'),
	(235,'omn','Oman',NULL,'om'),
	(236,'pak','Pakistan',NULL,'pk'),
	(237,'pan','Panama',NULL,'pa'),
	(238,'pcn','Pitcairn',NULL,'pn'),
	(239,'per','Peru',NULL,'pe'),
	(240,'phl','Philippines',NULL,'ph'),
	(241,'plw','Palau',NULL,'pw'),
	(242,'png','Papua New Guinea',NULL,'pg'),
	(243,'pol','Poland',NULL,'pl'),
	(244,'pri','Puerto Rico',NULL,'pr'),
	(245,'prk','Korea, Democratic People\'s Republic of',NULL,'kp'),
	(246,'prt','Portugal',NULL,'pt'),
	(247,'pry','Paraguay',NULL,'py'),
	(248,'pse','Palestinian Territory, Occupied',NULL,'ps'),
	(249,'pyf','French Polynesia',NULL,'pf'),
	(250,'qat','Qatar',NULL,'qa'),
	(251,'reu','Réunion',NULL,'re'),
	(252,'rou','Romania',NULL,'ro'),
	(253,'rus','Russian Federation',NULL,'ru'),
	(254,'rwa','Rwanda',NULL,'rw'),
	(255,'sau','Saudi Arabia',NULL,'sa'),
	(256,'sdn','Sudan',NULL,'sd'),
	(257,'sen','Senegal',NULL,'sn'),
	(258,'sgp','Singapore',NULL,'sg'),
	(259,'sgs','South Georgia and the South Sandwich Islands',NULL,'gs'),
	(260,'shn','Saint Helena, Ascension and Tristan da Cunha',NULL,'sh'),
	(261,'sjm','Svalbard and Jan Mayen',NULL,'sj'),
	(262,'slb','Solomon Islands',NULL,'sb'),
	(263,'sle','Sierra Leone',NULL,'sl'),
	(264,'slv','El Salvador',NULL,'sv'),
	(265,'smr','San Marino',NULL,'sm'),
	(266,'som','Somalia',NULL,'so'),
	(267,'spm','Saint Pierre and Miquelon',NULL,'pm'),
	(268,'srb','Serbia',NULL,'rs'),
	(269,'stp','Sao Tome and Principe',NULL,'st'),
	(270,'sur','Suriname',NULL,'sr'),
	(271,'svk','Slovakia',NULL,'sk'),
	(272,'svn','Slovenia',NULL,'si'),
	(273,'swe','Sweden',NULL,'se'),
	(274,'swz','Swaziland',NULL,'sz'),
	(275,'syc','Seychelles',NULL,'sc'),
	(276,'syr','Syrian Arab Republic',NULL,'sy'),
	(277,'tca','Turks and Caicos Islands',NULL,'tc'),
	(278,'tcd','Chad',NULL,'td'),
	(279,'tgo','Togo',NULL,'tg'),
	(280,'tha','Thailand',NULL,'th'),
	(281,'tjk','Tajikistan',NULL,'tj'),
	(282,'tkl','Tokelau',NULL,'tk'),
	(283,'tkm','Turkmenistan',NULL,'tm'),
	(284,'tls','Timor-Leste',NULL,'tl'),
	(285,'ton','Tonga',NULL,'to'),
	(286,'tto','Trinidad and Tobago',NULL,'tt'),
	(287,'tun','Tunisia',NULL,'tn'),
	(288,'tur','Turkey',NULL,'tr'),
	(289,'tuv','Tuvalu',NULL,'tv'),
	(290,'twn','Taiwan, Province of China',NULL,'tw'),
	(291,'tza','Tanzania, United Republic of',NULL,'tz'),
	(292,'uga','Uganda',NULL,'ug'),
	(293,'ukr','Ukraine',NULL,'ua'),
	(294,'umi','United States Minor Outlying Islands',NULL,'um'),
	(295,'ury','Uruguay',NULL,'uy'),
	(296,'usa','United States',1,'us'),
	(297,'uzb','Uzbekistan',NULL,'uz'),
	(298,'vat','Holy See (Vatican City State)',NULL,'va'),
	(299,'vct','Saint Vincent and the Grenadines',NULL,'vc'),
	(300,'ven','Venezuela, Bolivarian Republic of',NULL,'ve'),
	(301,'vgb','Virgin Islands, British',NULL,'vg'),
	(302,'vir','Virgin Islands, U.S.',NULL,'vi'),
	(303,'vnm','Viet Nam',NULL,'vn'),
	(304,'vut','Vanuatu',NULL,'vu'),
	(305,'wlf','Wallis and Futuna',NULL,'wf'),
	(306,'wsm','Samoa',NULL,'ws'),
	(307,'yem','Yemen',NULL,'ye'),
	(308,'zaf','South Africa',NULL,'za'),
	(309,'zmb','Zambia',NULL,'zm'),
	(310,'zwe','Zimbabwe',NULL,'zw');



# Dump of 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 DEFAULT CHARSET=utf8 COMMENT='List of known Soundminer library databases.';



# Dump of 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';


INSERT INTO `folder_states` (`user_id`, `type`, `id`, `state`)
VALUES
	(1,'folder',1,'open'),
	(2,'folder',2,'open'),
	(3,'folder',3,'open');



# Dump of 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 `owner_id` (`owner_id`),
  KEY `type` (`type`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


INSERT INTO `folders` (`id`, `owner_id`, `type`, `o_access`, `s_access`, `root_id`, `folder_id`, `path`, `name`, `created`, `updated`, `deleted`, `updated_by`, `orig_id`, `section`, `cuesheet_title`, `cuesheet_company`, `cuesheet_description`, `cuesheet_network`, `cuesheet_address1`, `cuesheet_address2`, `cuesheet_city`, `cuesheet_region`, `cuesheet_postal`, `cuesheet_country_iso`, `cuesheet_phone`)
VALUES
	(1,1,'private','read,add,modify,delete','',1,0,'/Admin:1/','Admin','0000-00-00 00:00:00','0000-00-00 00:00:00',0,0,NULL,'playlists',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
	(2,2,'private','read,add,modify,delete','',2,0,'/Guest:2/','Guest','0000-00-00 00:00:00','0000-00-00 00:00:00',0,0,NULL,'playlists',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
	(3,3,'private','read,add,modify,delete','',3,0,'/Default:3/','Default','0000-00-00 00:00:00','0000-00-00 00:00:00',0,0,NULL,'playlists',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
	(4,1,'inbox','read,delete','add',4,0,'/Admin:1/','Inbox','2010-10-25 15:05:23','2010-10-25 15:05:23',0,0,NULL,'playlists',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
	(5,2,'inbox','read,delete','add',5,0,'/Guest:2/','Inbox','2010-10-25 15:05:23','2010-10-25 15:05:23',0,0,NULL,'playlists',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
	(6,3,'inbox','read,delete','add',6,0,'/Default:3/','Inbox','2010-10-25 15:05:23','2010-10-25 15:05:23',0,0,NULL,'playlists',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
	(7,1,'published','read,add,modify,delete','read',7,0,'/Admin:1/','Published','2010-10-25 15:05:23','2010-10-25 15:05:23',0,0,NULL,'playlists',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
	(8,2,'published','read,add,modify,delete','read',8,0,'/Guest:2/','Published','2010-10-25 15:05:23','2010-10-25 15:05:23',0,0,NULL,'playlists',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
	(9,3,'published','read,add,modify,delete','read',9,0,'/Default:3/','Published','2010-10-25 15:05:23','2010-10-25 15:05:23',0,0,NULL,'playlists',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);



# Dump of table groups
# ------------------------------------------------------------

CREATE TABLE `groups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '0',
  `notes` varchar(255) NOT NULL,
  `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`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;



# Dump of 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 DEFAULT CHARSET=utf8;



# Dump of 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 DEFAULT CHARSET=utf8;



# Dump of 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;



# Dump of 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(4) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_event_index` (`user_id`,`event`),
  KEY `group_id` (`group_id`),
  KEY `role_id` (`role_id`),
  KEY `ctrl_name` (`ctrl_name`),
  KEY `ctrl_related_id` (`ctrl_related_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;



# Dump of 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) NOT NULL,
  `completed` tinyint(1) NOT NULL,
  PRIMARY KEY (`log_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;



# Dump of 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;



# Dump of 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`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


INSERT INTO `log_searches` (`log_id`, `query_id`, `lock`, `text`, `total`)
VALUES
	(2,1,0,'',0),
	(3,2,0,'',6);



# Dump of 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`),
  KEY `users_id` (`users_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;



# Dump of 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;


INSERT INTO `mimes` (`name`, `type`, `subtype`, `ext`, `mime`)
VALUES
	('MPEG Video','video','mpeg','mpg,mpeg,mpe','video/mpeg'),
	('QuickTime Video','video','quicktime','mov,qt','video/quicktime'),
	('Microsoft Video','video','x-msvideo','avi','video/x-msvideo'),
	('WAV Audio','audio','x-wav','wav','audio/x-wav'),
	('AIFF Audio','audio','x-aiff','aiff','audio/x-aiff'),
	('MIDI Audio','audio','x-midi','mid','audio/x-midi'),
	('MP3 Audio','audio','mpeg','mp3','audio/mpeg'),
	('MP2 Audio','audio','mpeg','mp2','audio/mpeg'),
	('MP1 Audio','audio','mpeg','mp1','audio/mpeg'),
	('MP4 Audio','audio','mp4','mp4,mpg4','audio/mp4'),
	('MP4 Video','video','mp4','mp4,mpg4','video/mp4');




# Dump of 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(128) DEFAULT NULL COMMENT 'Film or program title.',
  `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(12) DEFAULT NULL COMMENT 'Production number or ID.',
  `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(32) DEFAULT NULL COMMENT 'Type of program, such as cartoon, game show, soap opera, etc.',
  `version_type` varchar(32) DEFAULT NULL COMMENT 'Type of broadcast sources for which the cuesheet was created, such as network, cable, etc.',
  `job_no` varchar(32) DEFAULT NULL COMMENT 'Job number associated with the playlist/cuesheet.',
  `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.',
  `broadcast` tinyint(4) DEFAULT '0',
  `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,
  `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',
  `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,
  `public` tinyint(4) NOT NULL DEFAULT '0',
  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`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;



# Dump of 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 DEFAULT CHARSET=utf8;



# Dump of 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 `query_trim` (`query_trim`(333)),
  KEY `databases_trim` (`databases_trim`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


INSERT INTO `queries` (`id`, `databases`, `query`, `query_trim`, `databases_trim`)
VALUES
	(1,'','*','*',''),
	(2,'mwright','*','*','mwright');



# Dump of 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,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;



# Dump of 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 DEFAULT CHARSET=utf8;


INSERT INTO `reports` (`id`, `title`, `description`, `time`, `begin`, `end`, `users`, `tables`)
VALUES
	(1,'Activity Log','Chronological log of a user\'s activity.','all',NULL,NULL,0,'[{\"type\":\"detail\",\"title\":\"\",\"events\":[\"login\",\"logout\",\"search\",\"audition\",\"download\",\"error\"],\"groups\":[[\"Users\",\"user\",\"asc\",0,0],[null,\"date\",\"asc\",0,0]],\"fields\":[[null,\"time\",\"\",1,0,0,0,0],[null,\"event\",\"\",2,0,0,0,0],[null,\"info\",\"\",3,0,0,0,0]],\"limit\":null,\"grand\":null}]'),
	(2,'Search Summary','','all','0000-00-00 00:00:00','0000-00-00 00:00:00',0,'[{\"type\":\"summary\",\"title\":\"Most Popular\",\"events\":[\"search\"],\"limit\":null,\"grand\":true,\"groups\":[[\"Database(s)\",\"s_databases\",null,true,true],[\"Search Query\",\"s_query\",null,true,true]],\"fields\":[[\"# Searches\",\"id\",\"desc\",null,\"count\"],[\"# Users\",\"user\",\"desc\",null,\"dcount\"],[\"Min Found\",\"s_total\",null,null,\"min\"],[\"Max Found\",\"s_total\",null,null,\"max\"],[\"Avg Found\",\"s_total\",null,null,\"avg\"]]},{\"type\":\"summary\",\"title\":\"Fewest Results\",\"events\":[\"search\"],\"limit\":null,\"grand\":true,\"groups\":[[\"Database(s)\",\"s_databases\",null,true,true],[\"Search Query\",\"s_query\",null,true,true]],\"fields\":[[\"# Searches\",\"id\",\"desc\",2,\"count\"],[\"# Users\",\"user\",\"desc\",3,\"dcount\"],[\"Min Found\",\"s_total\",\"asc\",0,\"min\"],[\"Max Found\",\"s_total\",null,null,\"max\"],[\"Avg Found\",\"s_total\",\"asc\",1,\"avg\"]]},{\"type\":\"detail\",\"title\":\"Failed Searches By User\",\"events\":[\"search\"],\"limit\":null,\"grand\":true,\"groups\":[[\"User\",\"user\",\"asc\",false,false]],\"fields\":[[\"Time\",\"datetime\",\"asc\",null,false,false,false,false],[\"Database(s)\",\"s_databases\",\"asc\",null,false,false,false,false],[\"Query\",\"s_query\",\"asc\",null,false,false,false,false],[\"Results\",\"s_total\",\"asc\",2,false,false,false,false]],\"where\":[[\"s_total\",\"eq\",\"0\"]]}]'),
	(3,'Download Summary','','all',NULL,NULL,0,'[{\"type\":\"summary\",\"title\":\"Top Categories\",\"events\":[\"download\"],\"groups\":[[\"Category\",\"a_category\",\"\",1,1]],\"fields\":[[\"# Downloads\",\"id\",\"desc\",null,\"count\"],[\"# Assets\",\"a_id\",\"desc\",null,\"dcount\"]],\"where\":[],\"limit\":null,\"grand\":null},{\"type\":\"summary\",\"title\":\"Top Libraries\",\"events\":[\"download\"],\"groups\":[[\"Library\",\"a_library\",\"\",1,1]],\"fields\":[[\"# Downloads\",\"id\",\"desc\",null,\"count\"],[\"# Assets\",\"a_id\",\"desc\",null,\"dcount\"]],\"where\":[],\"limit\":null,\"grand\":null},{\"type\":\"summary\",\"title\":\"Top Albums\",\"events\":[\"download\"],\"groups\":[[\"Album\",\"a_cdtitle\",\"\",1,1]],\"fields\":[[\"# Downloads\",\"id\",\"desc\",null,\"count\"],[\"# Assets\",\"a_id\",\"desc\",null,\"dcount\"]],\"where\":[],\"limit\":null,\"grand\":null},{\"type\":\"summary\",\"title\":\"Top Users\",\"events\":[\"download\"],\"groups\":[[\"User\",\"user\",\"\",1,1]],\"fields\":[[\"# Downloads\",\"id\",\"desc\",null,\"count\"],[\"# Assets\",\"a_id\",\"desc\",null,\"dcount\"]],\"where\":[],\"limit\":null,\"grand\":null}]'),
	(4,'Download Log','Detailed log of downloads grouped by user.','all',NULL,NULL,0,'[{\"type\":\"detail\",\"title\":\"\",\"events\":[\"download\"],\"groups\":[[\"User\",\"user\",\"asc\",0,1]],\"fields\":[[null,\"datetime\",\"asc\",null,0,0,0,0],[null,\"host_ip\",\"\",null,0,0,0,0],[null,\"a_library\",\"\",null,0,0,0,0],[null,\"a_cdtitle\",\"\",null,0,0,0,0],[\"Type\",\"d_filetype\",\"\",null,0,0,0,0],[null,\"d_filename\",\"\",null,0,0,0,0],[\"Size\",\"d_filebytes\",\"\",null,1,0,0,0]],\"limit\":null,\"grand\":null}]'),
	(5,'Browser Summary','','all',NULL,NULL,0,'[{\"type\":\"summary\",\"title\":\"Browsers\",\"events\":[\"login\",\"logout\",\"search\",\"audition\",\"download\",\"error\"],\"groups\":[[\"Browser\",\"b_full\",\"\",1,0]],\"fields\":[[\"# Users\",\"user\",\"desc\",null,\"dcount\"]],\"where\":[],\"limit\":null,\"grand\":1},{\"type\":\"summary\",\"title\":\"Platforms\",\"events\":[\"login\",\"logout\",\"search\",\"audition\",\"download\",\"error\"],\"groups\":[[null,\"b_platform\",\"\",1,0]],\"fields\":[[\"# Users\",\"user\",\"desc\",null,\"dcount\"]],\"where\":[],\"limit\":null,\"grand\":1}]');



# Dump of 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`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


INSERT INTO `roles` (`id`, `name`, `notes`, `settings_id`)
VALUES
	(1,'Administrator','Administrators get full access to all administrative functions, download rights to all assets, and the ability to view all metadata pertaining to an asset.',4),
	(2,'Supervisor','',5),
	(3,'Superuser','',6),
	(4,'User','',7),
	(5,'Guest','',8);



# Dump of 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;


INSERT INTO `schema` (`schema`, `db_ver`, `mm_ver`, `sm_ver`, `guid`)
VALUES
	('mm_admin','1.2.3.4','1.2.4.7','1.2.3','f71150dee08311df9796d0b722832d55');



# Dump of 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`),
  KEY `widgets_id` (`widgets_id`),
  KEY `sequence` (`sequence`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;



# Dump of 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`),
  KEY `widgets_id` (`widgets_id`),
  KEY `sequence` (`sequence`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;



# Dump of 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 DEFAULT CHARSET=utf8 COMMENT='User''s saved search queries';



# Dump of 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,
  PRIMARY KEY (`id`),
  KEY `sequence` (`sequence`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;



# Dump of 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`),
  KEY `sequence` (`sequence`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;



# Dump of 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`),
  KEY `touched` (`touched`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


INSERT INTO `sessions` (`id`, `data`, `touched`, `uid`, `logout`, `reason`)
VALUES
	('0sh4i19vc9cnqnthnqd0b237d5','__session__|a:0:{}flash|a:0:{}login|a:1:{s:9:\"challenge\";s:32:\"8d6d21cc634fb46c5003b17f90967134\";}uid|i:1;m|a:1:{s:8:\"login_id\";i:5;}content|a:0:{}HistoryModel|a:2:{s:6:\"_count\";i:1;s:5:\"_next\";i:1;}',1289856215,1,0,NULL);



# Dump of 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.';



# Dump of 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.';


# Dump of 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`),
  KEY `sequence` (`sequence`),
  KEY `tab_id` (`tab_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;



# Dump of 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`),
  KEY `sequence` (`sequence`),
  KEY `widgets_id` (`widgets_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;



# Dump of 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,
  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` (`track_id`),
  KEY `ndx` (`ndx`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


# Dump of 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;



# Dump of 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 DEFAULT CHARSET=latin1;



# Dump of 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`),
  KEY `widgets_id` (`widgets_id`,`role_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;




