


ALTER TABLE assets MODIFY COLUMN `Pathname` varchar(255) DEFAULT NULL;
ALTER TABLE assets MODIFY COLUMN `FilePath` text;
ALTER TABLE assets MODIFY COLUMN `Duration` varchar(20) DEFAULT NULL;
ALTER TABLE assets MODIFY COLUMN `FileType` varchar(4) DEFAULT NULL;
ALTER TABLE assets MODIFY COLUMN `CreationDate` datetime DEFAULT NULL;
ALTER TABLE assets MODIFY COLUMN `ModificationDate` datetime DEFAULT NULL;
ALTER TABLE assets MODIFY COLUMN `Composer` varchar(512) DEFAULT NULL;
ALTER TABLE assets MODIFY COLUMN `Publisher` varchar(512) DEFAULT NULL;




ALTER TABLE assets ADD `RecID` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `Popularity` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `Rating` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_FlatCategory` varchar(255) DEFAULT NULL;
ALTER TABLE assets ADD `Time` time DEFAULT NULL;
ALTER TABLE assets ADD `Volume` varchar(100) DEFAULT NULL;
ALTER TABLE assets ADD `Track` bigint(20) DEFAULT NULL;
ALTER TABLE assets ADD `Index` smallint(6) DEFAULT NULL;
ALTER TABLE assets ADD `_Dirty` smallint(6) DEFAULT NULL;
ALTER TABLE assets ADD `Lyrics` text;
ALTER TABLE assets ADD `Source` varchar(64) DEFAULT NULL;
ALTER TABLE assets ADD `Category` varchar(64) DEFAULT NULL;
ALTER TABLE assets ADD `SubCategory` varchar(128) DEFAULT NULL;
ALTER TABLE assets ADD `FXName` varchar(128) DEFAULT NULL;
ALTER TABLE assets ADD `Notes` varchar(1000) DEFAULT NULL;
ALTER TABLE assets ADD `Show` varchar(62) DEFAULT NULL;
ALTER TABLE assets ADD `Library` varchar(150) DEFAULT NULL;
ALTER TABLE assets ADD `RecType` varchar(62) DEFAULT NULL;
ALTER TABLE assets ADD `ShortID` varchar(31) DEFAULT NULL;
ALTER TABLE assets ADD `LongID` varchar(128) DEFAULT NULL;
ALTER TABLE assets ADD `RecMedium` varchar(62) DEFAULT NULL;
ALTER TABLE assets ADD `Keywords` varchar(1000) DEFAULT NULL;
ALTER TABLE assets ADD `Location` varchar(128) DEFAULT NULL;
ALTER TABLE assets ADD `Microphone` varchar(62) DEFAULT NULL;
ALTER TABLE assets ADD `Arranger` varchar(128) DEFAULT NULL;
ALTER TABLE assets ADD `Conductor` varchar(128) DEFAULT NULL;
ALTER TABLE assets ADD `Performer` varchar(128) DEFAULT NULL;
ALTER TABLE assets ADD `BPM` varchar(31) DEFAULT NULL;
ALTER TABLE assets ADD `Key` varchar(15) DEFAULT NULL;
ALTER TABLE assets ADD `Manufacturer` varchar(150) DEFAULT NULL;
ALTER TABLE assets ADD `Designer` varchar(62) DEFAULT NULL;
ALTER TABLE assets ADD `CDDescription` varchar(1000) DEFAULT NULL;
ALTER TABLE assets ADD `Scene` varchar(31) DEFAULT NULL;
ALTER TABLE assets ADD `Take` varchar(31) DEFAULT NULL;
ALTER TABLE assets ADD `Tape` varchar(31) DEFAULT NULL;
ALTER TABLE assets ADD `Mood` varchar(1000) DEFAULT NULL;
ALTER TABLE assets ADD `Version` varchar(62) DEFAULT NULL;
ALTER TABLE assets ADD `BWDescription` varchar(1000) DEFAULT NULL;
ALTER TABLE assets ADD `BWOriginator` varchar(62) DEFAULT NULL;
ALTER TABLE assets ADD `BWOriginatorRef` varchar(62) DEFAULT NULL;
ALTER TABLE assets ADD `BWTimeStamp` varchar(11) DEFAULT NULL;
ALTER TABLE assets ADD `BWTime` varchar(8) DEFAULT NULL;
ALTER TABLE assets ADD `BWDate` varchar(10) DEFAULT NULL;
ALTER TABLE assets ADD `smint_track_id` varchar(50) DEFAULT NULL;
ALTER TABLE assets ADD `spectral_external_key` varchar(50) DEFAULT NULL;
ALTER TABLE assets ADD `TouchedDate` double DEFAULT NULL;
ALTER TABLE assets ADD `Artist` varchar(255) DEFAULT NULL;
ALTER TABLE assets ADD `Usage` varchar(128) DEFAULT NULL;
ALTER TABLE assets ADD `TrackYear` varchar(31) DEFAULT NULL;
ALTER TABLE assets ADD `UserComments` varchar(255) DEFAULT NULL;
ALTER TABLE assets ADD `Tempo` varchar(62) DEFAULT NULL;
ALTER TABLE assets ADD `NewSource` varchar(128) DEFAULT NULL;
ALTER TABLE assets ADD `_smint_track_id` varchar(50) DEFAULT NULL;
ALTER TABLE assets ADD `JDNotes` varchar(1000) DEFAULT NULL;
ALTER TABLE assets ADD `ReleaseDate` date DEFAULT NULL;
ALTER TABLE assets ADD `cdndate` datetime DEFAULT NULL;
ALTER TABLE assets ADD `cdnstale` tinyint(4) DEFAULT NULL;
ALTER TABLE assets ADD `foxnewname` varchar(50) DEFAULT NULL;
ALTER TABLE assets ADD `ScannedDate` datetime DEFAULT NULL;
ALTER TABLE assets ADD `ISRC` varchar(16) DEFAULT NULL;
ALTER TABLE assets ADD `URL` varchar(512) DEFAULT NULL;
ALTER TABLE assets ADD `_PathnameLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_CategoryLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_ManufacturerLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_LibraryLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_DesignerLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_CDTitleLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_ComposerLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_FeaturedInstrumentLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_BPMLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_VolumeLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_ShowLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_SceneLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_TapeLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_ShortIDLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_MoodLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_UsageLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `CueTime` varchar(255) DEFAULT NULL;
ALTER TABLE assets ADD `CueInTime` varchar(255) DEFAULT NULL;
ALTER TABLE assets ADD `CueOutTime` varchar(255) DEFAULT NULL;
ALTER TABLE assets ADD `AudioFileType` varchar(4) DEFAULT NULL;
ALTER TABLE assets ADD `_Time` float unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_FilePathHash` varchar(62) DEFAULT NULL;
ALTER TABLE assets ADD `_AudioCRC` varchar(32) DEFAULT NULL;
ALTER TABLE assets ADD `_Tags` varchar(255) DEFAULT NULL;
ALTER TABLE assets ADD `_OriginalFilename` varchar(255) DEFAULT NULL;
ALTER TABLE assets ADD `_SubCategoryLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_ArrangerLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_ArtistLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_ConductorLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_PublisherLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_PerformerLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_TrackYearLink` int(10) unsigned DEFAULT NULL;
ALTER TABLE assets ADD `_KeyLink` int(10) unsigned DEFAULT NULL;

ALTER TABLE `assets` ADD KEY `RecID` (`RecID`),
                     ADD KEY `track_id` (`track_id`);





--
-- 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 AUTO_INCREMENT=37 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,
  PRIMARY KEY (`id`),
  KEY `users_id` (`users_id`)
) ENGINE=MyISAM AUTO_INCREMENT=13 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_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 AUTO_INCREMENT=2 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,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 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 AUTO_INCREMENT=3 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 AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;



--
-- 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;



ALTER TABLE `countries` MODIFY COLUMN `custom_order` int(11) DEFAULT NULL;

ALTER TABLE `countries` ADD `regional_site_title` varchar(255) DEFAULT NULL;
ALTER TABLE `countries` ADD `regional_site_description` text;
ALTER TABLE `countries` ADD `regional_site_keywords` text;
ALTER TABLE `countries` ADD `regional_reg_emails` text;
ALTER TABLE `countries` ADD `regional_help_url` text;

ALTER TABLE `countries` ADD KEY `country_name` (`country_name`),
                        ADD KEY `custom_order` (`custom_order`);




ALTER TABLE `folders` ADD `section` enum('playlists','cuesheets') DEFAULT 'playlists';
ALTER TABLE `folders` ADD `cuesheet_title` varchar(100) DEFAULT NULL;
ALTER TABLE `folders` ADD `cuesheet_company` varchar(100) DEFAULT NULL;
ALTER TABLE `folders` ADD `cuesheet_description` varchar(250) DEFAULT NULL;
ALTER TABLE `folders` ADD `cuesheet_network` varchar(100) DEFAULT NULL;
ALTER TABLE `folders` ADD `cuesheet_address1` varchar(100) DEFAULT NULL;
ALTER TABLE `folders` ADD `cuesheet_address2` varchar(100) DEFAULT NULL;
ALTER TABLE `folders` ADD `cuesheet_city` varchar(50) DEFAULT NULL;
ALTER TABLE `folders` ADD `cuesheet_region` varchar(50) DEFAULT NULL;
ALTER TABLE `folders` ADD `cuesheet_postal` varchar(25) DEFAULT NULL;
ALTER TABLE `folders` ADD `cuesheet_country_iso` varchar(3) DEFAULT NULL;
ALTER TABLE `folders` ADD `cuesheet_phone` varchar(25) DEFAULT NULL;

ALTER TABLE `folders` ADD KEY `updated_by` (`updated_by`),
                      ADD KEY `root_id` (`root_id`),
                      ADD KEY `owner_id` (`owner_id`);



ALTER TABLE `groups` MODIFY COLUMN `notes` text;

ALTER TABLE `groups` ADD KEY `settings_id` (`settings_id`);



ALTER TABLE `help` ADD `date_created` datetime NOT NULL;
ALTER TABLE `help` ADD `sequence` int(11) NOT NULL DEFAULT '0';


ALTER TABLE `history` ADD `public_session_id` varchar(40) NOT NULL DEFAULT '';






--
-- 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;




ALTER TABLE `log`
  ADD KEY `idx_log_time` (`time`),
  ADD KEY `idx_log_host` (`host_id`),
  ADD KEY `idx_log_browser` (`browser_id`),
  ADD KEY `idx_onepages_stats` (`ctrl_name`,`ctrl_related_id`),
  ADD KEY `group_id` (`group_id`),
  ADD KEY `role_id` (`role_id`),
  ADD KEY `user_id` (`user_id`);


ALTER TABLE `log_downloads` MODIFY COLUMN `file_type` varchar(255) DEFAULT NULL;

ALTER TABLE `log_downloads`
  ADD KEY `asset_id` (`asset_id`),
  ADD KEY `file_type` (`file_type`),
  ADD KEY `file_path` (`file_path`(333)),
  ADD KEY `file_size` (`file_size`);



ALTER TABLE `log_searches`
  ADD KEY `query_id` (`query_id`),
  ADD KEY `total` (`total`);
  


--
-- 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;







ALTER TABLE `onepages` MODIFY COLUMN `password` varchar(50) DEFAULT NULL;


ALTER TABLE `onepages` ADD `pitch_display` tinyint(4) NOT NULL DEFAULT '0';
ALTER TABLE `onepages` ADD `pitch_type` varchar(25) DEFAULT NULL;
ALTER TABLE `onepages` ADD `pitch_performer_name` varchar(100) DEFAULT NULL;
ALTER TABLE `onepages` ADD `pitch_purpose` varchar(25) DEFAULT NULL;
ALTER TABLE `onepages` ADD `pitch_method` varchar(25) DEFAULT NULL;
ALTER TABLE `onepages` ADD `pitch_status` varchar(25) DEFAULT NULL;
ALTER TABLE `onepages` ADD `pitch_to` varchar(100) DEFAULT NULL;
ALTER TABLE `onepages` ADD `pitch_contact_role` varchar(50) DEFAULT NULL;
ALTER TABLE `onepages` ADD `pitch_notes` text;
ALTER TABLE `onepages` ADD `register_with_external_app` tinyint(4) DEFAULT '0';
ALTER TABLE `onepages` ADD `password_required` tinyint(4) DEFAULT '0';
ALTER TABLE `onepages` ADD `is_public` tinyint(4) NOT NULL DEFAULT '0';


ALTER TABLE `onepages`
  ADD KEY `user_id` (`user_id`),
  ADD KEY `expires` (`expires`);


    

--
-- 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;




ALTER TABLE `playlists` MODIFY COLUMN `title` varchar(200) DEFAULT NULL;
ALTER TABLE `playlists` MODIFY COLUMN `production_no` varchar(100) DEFAULT NULL;
ALTER TABLE `playlists` MODIFY COLUMN `program_type` varchar(100) DEFAULT NULL;
ALTER TABLE `playlists` MODIFY COLUMN `version_type` varchar(100) DEFAULT NULL;
ALTER TABLE `playlists` MODIFY COLUMN `job_no` varchar(100) DEFAULT NULL;



ALTER TABLE `playlists` ADD `broadcast` tinyint(4) DEFAULT NULL;
ALTER TABLE `playlists` ADD `creator_id` varchar(25) DEFAULT NULL;
ALTER TABLE `playlists` ADD `production_company` varchar(100) DEFAULT NULL;
ALTER TABLE `playlists` ADD `category` varchar(25) DEFAULT NULL;
ALTER TABLE `playlists` ADD `production_year` varchar(4) DEFAULT NULL;
ALTER TABLE `playlists` ADD `animation_indicator` tinyint(4) DEFAULT '0';
ALTER TABLE `playlists` ADD `master_cuesheet_indicator` tinyint(4) DEFAULT '0';
ALTER TABLE `playlists` ADD `public` tinyint(4) NOT NULL DEFAULT '0';
ALTER TABLE `playlists` ADD `originator_first_name` varchar(50) DEFAULT NULL;
ALTER TABLE `playlists` ADD `originator_last_name` varchar(50) DEFAULT NULL;
ALTER TABLE `playlists` ADD `originator_email` varchar(255) DEFAULT NULL;
ALTER TABLE `playlists` ADD `originator_user_id` int(11) DEFAULT NULL;


ALTER TABLE `playlists`
    ADD KEY `updated_by` (`updated_by`),
    ADD KEY `deleted` (`deleted`),
    ADD KEY `title` (`title`),
    ADD KEY `root_id` (`root_id`),
    ADD KEY `type` (`type`);



ALTER TABLE `proxies` ADD KEY `db_id` (`db_id`);


ALTER TABLE `queries` ADD `query_trim` varchar(500) DEFAULT NULL;
ALTER TABLE `queries` ADD `databases_trim` varchar(100) DEFAULT NULL;



ALTER TABLE `queries`
    ADD KEY `databases_trim` (`databases_trim`),
    ADD KEY `query_trim` (`query_trim`(333));
    
    


ALTER TABLE `quick_search_options` ADD `widgets_id` int(11) DEFAULT NULL;
ALTER TABLE `quick_search_options` ADD `img` varchar(255) DEFAULT NULL;


ALTER TABLE `roles`
  ADD KEY `settings_id` (`settings_id`),
  ADD KEY `name` (`name`);




--
-- 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=3 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=3 DEFAULT CHARSET=latin1;


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

ALTER TABLE `selective_search_groups` ADD `description` varchar(250) DEFAULT NULL;

ALTER TABLE `selective_search_options` ADD `parent_title` varchar(100) DEFAULT NULL;


ALTER TABLE `settings` ADD  `s_topics_show` enum('hide','show') DEFAULT 'hide';
ALTER TABLE `settings` ADD  `u_topics_show` enum('hide','show') DEFAULT 'hide';
ALTER TABLE `settings` ADD  `p_times` varchar(25) DEFAULT NULL;
ALTER TABLE `settings` ADD  `u_continuous_show` enum('on','off') DEFAULT 'on';
ALTER TABLE `settings` ADD  `s_continuous_show` enum('on','off') DEFAULT 'on';
ALTER TABLE `settings` ADD  `u_panel_selected` int(11) DEFAULT '0';
ALTER TABLE `settings` ADD  `u_static_options` text;
ALTER TABLE `settings` ADD  `s_topics_show_details` text;
ALTER TABLE `settings` ADD  `u_topics_show_details` text;
ALTER TABLE `settings` ADD  `s_set_topics_sections` text;
ALTER TABLE `settings` ADD  `u_set_topics_sections` text;
ALTER TABLE `settings` ADD  `p_admin_download_xml` tinyint(4) DEFAULT NULL;
ALTER TABLE `settings` ADD  `thesaurus_status` tinyint(1) DEFAULT NULL;



ALTER TABLE `site` MODIFY COLUMN `player` enum('html5','html5fullAltOne','flashV2','flashV3','waveformPlayer','flash','quicktime','universal','qtSimple','flowPlayer','flashMp3Player','xspfPlayerSlim','originalSingle','jwPlayer','resizableMp3Player','html5full') DEFAULT NULL;

ALTER TABLE `site` MODIFY COLUMN `registration_alert` text;


ALTER TABLE `site` ADD  `cue_col_details` varchar(500) DEFAULT NULL;
ALTER TABLE `site` ADD  `reg_emails` text;
ALTER TABLE `site` ADD  `password_length` tinyint(4) DEFAULT NULL;
ALTER TABLE `site` ADD  `password_complexity` tinyint(4) DEFAULT '0';



--
-- 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=123 DEFAULT CHARSET=latin1;



ALTER TABLE `static_search_options` MODIFY COLUMN `sequence` int(11) DEFAULT NULL;

ALTER TABLE `static_search_options` ADD `widgets_id` int(11) DEFAULT NULL;

ALTER TABLE `static_search_options` ADD KEY `category` (`category`);



ALTER TABLE `static_search_tabs` ADD `widgets_id` int(11) DEFAULT NULL;


ALTER TABLE `tracks` ADD `CueInTime` varchar(30) DEFAULT NULL;
ALTER TABLE `tracks` ADD `CueOutTime` varchar(30) DEFAULT NULL;
ALTER TABLE `tracks` ADD `CueTime` varchar(30) DEFAULT NULL;
ALTER TABLE `tracks` ADD `CuePublisher` text;
ALTER TABLE `tracks` ADD `CueComposer` text;
ALTER TABLE `tracks` ADD `CueUsage` varchar(250) DEFAULT NULL;
ALTER TABLE `tracks` ADD `CueUpLoaded` int(5) DEFAULT NULL;
ALTER TABLE `tracks` ADD `track_comments` text;


ALTER TABLE `tracks` ADD KEY `track_id_x1` (`track_id`),
                    ADD KEY `ndx` (`ndx`);



--
-- 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;



ALTER TABLE `users` MODIFY COLUMN `player` enum('html5','html5fullAltOne','flashV2','flashV3','waveformPlayer','flash','quicktime','universal','qtSimple','flowPlayer','flashMp3Player','xspfPlayerSlim','originalSingle','jwPlayer','resizableMp3Player','html5full') DEFAULT NULL;

ALTER TABLE `users` MODIFY COLUMN  `phone_fax` varchar(32) DEFAULT NULL;
ALTER TABLE `users` MODIFY COLUMN  `phone_cell` varchar(32) DEFAULT NULL;
ALTER TABLE `users` MODIFY COLUMN  `date_registered` datetime DEFAULT NULL;
ALTER TABLE `users` MODIFY COLUMN  `original_external_imported_id` int(4) DEFAULT NULL;

ALTER TABLE `users` ADD  `original_cuegle_id` int(4) DEFAULT NULL;
ALTER TABLE `users` ADD  `country_text` varchar(100) DEFAULT NULL;

ALTER TABLE `users` ADD KEY `group_id` (`group_id`),
                    ADD KEY `role_id` (`role_id`),
                    ADD KEY `settings_id` (`settings_id`),
                    ADD KEY `folder_id` (`folder_id`),
                    ADD KEY `enabled` (`enabled`),
                    ADD KEY `is_public` (`is_public`),
                    ADD KEY `country_text` (`country_text`);
                    
                    

ALTER TABLE `widgets` MODIFY COLUMN `key_code` varchar(50) NOT NULL;

ALTER TABLE `widgets` ADD `title` varchar(50) DEFAULT NULL;
ALTER TABLE `widgets` ADD `widgets_id` int(11) DEFAULT NULL;



--
-- 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;




