use [% wp %];

ALTER TABLE `[% table_prefix %]_comments`
CHANGE COLUMN `user_id` `user_id` bigint(20) unsigned NOT NULL default '0';

ALTER TABLE `[% table_prefix %]_comments`
CHANGE COLUMN `comment_parent` `comment_parent` bigint(20) unsigned NOT NULL default '0';

ALTER TABLE `[% table_prefix %]_comments`
CHANGE COLUMN `comment_post_ID` `comment_post_ID` bigint(20) unsigned NOT NULL default '0';

ALTER TABLE `[% table_prefix %]_links`
CHANGE COLUMN `link_owner` `link_owner` bigint(20) unsigned NOT NULL default '1';

ALTER TABLE `[% table_prefix %]_links`
CHANGE COLUMN `link_id` `link_id` bigint(20) unsigned NOT NULL auto_increment;

ALTER TABLE `[% table_prefix %]_links`
DROP INDEX `link_category`;

ALTER TABLE `[% table_prefix %]_links`
DROP COLUMN `link_category`;

ALTER TABLE `[% table_prefix %]_options`
CHANGE COLUMN `option_id` `option_id` bigint(20) unsigned NOT NULL auto_increment;

ALTER TABLE `[% table_prefix %]_postmeta`
CHANGE COLUMN `meta_id` `meta_id` bigint(20) unsigned NOT NULL auto_increment;

ALTER TABLE `[% table_prefix %]_postmeta`
CHANGE COLUMN `post_id` `post_id` bigint(20) unsigned NOT NULL default '0';

ALTER TABLE `[% table_prefix %]_posts`
CHANGE COLUMN `post_parent` `post_parent` bigint(20) unsigned NOT NULL default '0';

ALTER TABLE `[% table_prefix %]_posts`
DROP COLUMN `post_category`;

ALTER TABLE `[% table_prefix %]_posts`
CHANGE COLUMN `post_author` `post_author` bigint(20) unsigned NOT NULL default '0';

ALTER TABLE `[% table_prefix %]_term_relationships`
CHANGE COLUMN `object_id` `object_id` bigint(20) unsigned NOT NULL default '0';

ALTER TABLE `[% table_prefix %]_term_relationships`
CHANGE COLUMN `term_taxonomy_id` `term_taxonomy_id` bigint(20) unsigned NOT NULL default '0';

ALTER TABLE `[% table_prefix %]_term_taxonomy`
CHANGE COLUMN `term_id` `term_id` bigint(20) unsigned NOT NULL default '0';

ALTER TABLE `[% table_prefix %]_term_taxonomy`
CHANGE COLUMN `term_taxonomy_id` `term_taxonomy_id` bigint(20) unsigned NOT NULL auto_increment;

ALTER TABLE `[% table_prefix %]_term_taxonomy`
CHANGE COLUMN `parent` `parent` bigint(20) unsigned NOT NULL default '0';

ALTER TABLE `[% table_prefix %]_term_taxonomy`
DROP INDEX `term_id_taxonomy`;

ALTER TABLE `[% table_prefix %]_term_taxonomy`
ADD INDEX `term_id_taxonomy` (`term_id`,`taxonomy`);

ALTER TABLE `[% table_prefix %]_term_taxonomy`
ADD INDEX `taxonomy` (`taxonomy`);

ALTER TABLE `[% table_prefix %]_terms`
CHANGE COLUMN `term_id` `term_id` bigint(20) unsigned NOT NULL auto_increment;

ALTER TABLE `[% table_prefix %]_usermeta`
CHANGE COLUMN `user_id` `user_id` bigint(20) unsigned NOT NULL default '0';

ALTER TABLE `[% table_prefix %]_usermeta`
CHANGE COLUMN `umeta_id` `umeta_id` bigint(20) unsigned NOT NULL auto_increment;

UPDATE `[% table_prefix %]_options`
SET option_value = '11548'
WHERE option_name = 'db_version';

