DROP DATABASE IF EXISTS `crash_mysqld`;
CREATE DATABASE IF NOT EXISTS `crash_mysqld`;
USE `crash_mysqld`;
CREATE TABLE `instances` (`id` integer PRIMARY KEY AUTO_INCREMENT, `job` varchar(255) NOT NULL, `index` integer NOT NULL, `disk_cid` varchar(255) NULL UNIQUE, `deployment_id` integer NOT NULL, `vm_id` integer NULL UNIQUE);
ALTER TABLE `instances` ADD COLUMN `state` varchar(255);
ALTER TABLE `instances` CHANGE COLUMN `state` `state` varchar(255) NOT NULL;
ALTER TABLE `instances` ADD COLUMN `disk_size` integer;
ALTER TABLE `instances` DROP COLUMN `disk_cid`, DROP COLUMN `disk_size`;
ALTER TABLE `instances` ADD COLUMN `resurrection_paused` tinyint(1);
ALTER TABLE `instances` CHANGE COLUMN `resurrection_paused` `resurrection_paused` tinyint(1) NULL DEFAULT 0;
ALTER TABLE `instances` ADD COLUMN `uuid` varchar(255) UNIQUE;
ALTER TABLE `instances` ADD COLUMN `availability_zone` varchar(255), ADD COLUMN `cloud_properties` text;
ALTER TABLE `instances` ADD COLUMN `compilation` tinyint(1) DEFAULT 0;
ALTER TABLE `instances` ADD COLUMN `bootstrap` tinyint(1) DEFAULT 0;
ALTER TABLE `instances` ADD COLUMN `dns_records` text;
ALTER TABLE `instances` ADD COLUMN `spec_json` text;
ALTER TABLE `instances` ADD COLUMN `vm_cid` varchar(255) UNIQUE, ADD COLUMN `agent_id` varchar(255) UNIQUE, ADD COLUMN `credentials_json` text, ADD COLUMN `vm_env_json` text, ADD COLUMN `trusted_certs_sha1` varchar(255) DEFAULT 'da39a3ee5e6b4b0d3255bfef95601890afd80709';
ALTER TABLE `instances` DROP COLUMN `vm_env_json`;
ALTER TABLE `instances` ADD COLUMN `post_start_completed` tinyint(1) DEFAULT 1;
ALTER TABLE `instances` CHANGE COLUMN `post_start_completed` `update_completed` tinyint(1) NULL DEFAULT 1;
ALTER TABLE `instances` CHANGE COLUMN `update_completed` `update_completed` tinyint(1) NULL DEFAULT 0;
ALTER TABLE `instances` ADD COLUMN `ignore` tinyint(1) DEFAULT 0;
ALTER TABLE `instances` CHANGE COLUMN `cloud_properties` `cloud_properties` longtext NULL;
ALTER TABLE `instances` CHANGE COLUMN `dns_records` `dns_records` longtext NULL;
ALTER TABLE `instances` CHANGE COLUMN `spec_json` `spec_json` longtext NULL;
ALTER TABLE `instances` CHANGE COLUMN `credentials_json` `credentials_json` longtext NULL;
ALTER TABLE `instances` ADD COLUMN `variable_set_id` integer;
ALTER TABLE `instances` CHANGE COLUMN `variable_set_id` `variable_set_id` int(11) NOT NULL;
ALTER TABLE `instances` ADD COLUMN `active_vm_id` integer;
ALTER TABLE `instances` CHANGE COLUMN `vm_cid` `vm_cid_bak` varchar(255) NULL, CHANGE COLUMN `credentials_json` `credentials_json_bak` longtext NULL, CHANGE COLUMN `agent_id` `agent_id_bak` varchar(255) NULL, CHANGE COLUMN `trusted_certs_sha1` `trusted_certs_sha1_bak` varchar(255) NULL DEFAULT 'da39a3ee5e6b4b0d3255bfef95601890afd80709';