/* April 12, 2011 */
alter table `genre` add column `description` text default null after `name`;

/* April 14, 2011 */
alter table `release` add column `utype` enum('artist', 'label') default 'artist' after `title`;
alter table `release` change column `artistid` `umapid` bigint unsigned not null;

alter table `song` add column `utype` enum('artist', 'label') default 'artist' after `genre2id`;
alter table `song` change column `artistid` `umapid` bigint unsigned not null;

/* April 18, 2011 */
alter table `song` change column `file` `fileflac` varchar(255) default null;
alter table `song` add column `filemp3320` varlocchar(255) default null after `fileflac`;
alter table `song` add column `filemp3128` varchar(255) default null after `filemp3320`;

/* April 25, 2011 */
alter table `song` change column `legth` `length` varchar(255) default null;

/* Friday, April 29 2011 */
alter table `user` add column `priority` tinyint default 1 after `ip`;
alter table `label` add column `priority` tinyint default 1 after `url`;
alter table `artist` add column `priority` tinyint default 1 after `ip`;
alter table `release` add column `priority` tinyint default 1 after `artwork`;
alter table `song` add column `priority` tinyint default 1 after `credit`;

/* Sunday, May 01 2011 */
alter table `release` drop column `genreid`;
alter table `release` add column `genreid` smallint unsigned not null after `umapid`;
alter table `release` add column `artistid` bigint unsigned not null after `genreid`;
alter table `release` add column `labelid` smallint unsigned not null after `artistid`;
alter table `release` add column `rcn` varchar(255) default null after `labelid`;
alter table `release` drop column `recordlabel`;
alter table `release` add column `released` binary default 0 after `priority`;

alter table `song` drop column `genreid`;
alter table `song` drop column `genre2id`;
alter table `song` change column `remixer1` `remixer` varchar(255) default null;
alter table `song` drop column `remixer2`;
alter table `song` drop column `remixer3`;
alter table `song` change column `composer1` `composer` varchar(255) default null;
alter table `song` drop column `composer2`;
alter table `song` drop column `composer3`;
alter table `song` change column `author1` `author` varchar(255) default null;
alter table `song` drop column `author2`;
alter table `song` drop column `author3`;
alter table `song` change column `publisher1` `publisher` varchar(255) default null;
alter table `song` drop column `publisher2`;
alter table `song` drop column `publisher3`;
alter table `song` add column `artist` varchar(255) not null after `title`;
alter table `song` add column `produced` varchar(255) default null after `publisher`;

ALTER DATABASE `litentoit` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
SELECT CONCAT('ALTER TABLE `', t.`TABLE_SCHEMA`, '`.`', t.`TABLE_NAME`, '` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;') as stmt FROM `information_schema`.`TABLES` t WHERE 1 AND t.`TABLE_SCHEMA` = 'listentoit' ORDER BY 1;

ALTER TABLE `listentoit`.`affiliation` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `listentoit`.`artist` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `listentoit`.`country` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `listentoit`.`genre` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `listentoit`.`label` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `listentoit`.`master` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `listentoit`.`release` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `listentoit`.`song` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `listentoit`.`subscription` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `listentoit`.`user_affiliation` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `listentoit`.`user` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;

/* Thursday, May 12 2011 */
alter table `release` change column `artwork` `artwork_b` varchar(255) default null;
alter table `release` add column `artwork_m` varchar(255) default null after `artwork_b`;
alter table `release` add column `artwork_s` varchar(255) default null after `artwork_m`;

/* Tuesday, May 17 2011 */
alter table `song` change column `releaseid` `releaseid` bigint unsigned not null default 0;

/* Saturday, May 28 2011 */
alter table `song` add column `waveform` varchar(255) default null after `filemp3128`;

/* Thursday, June 9 2011 */
alter table `song` add column `preview` varchar(255) default null after `filemp3128`;

/* Friday, June 10 2011 */
alter table `song` add column `preview_waveform` varchar(255) default null after `waveform`;

/* Sunday, June 12 2011 */
alter table `song` add column `preview_startpt` varchar(255) default '00:00' after `length`;

