-- Deploy gaia:2020_07_23_alter_table_add_device_type to mysql

BEGIN;

-- XXX Add DDLs here.
ALTER TABLE `api_greetingpopup` ADD COLUMN `device_type` VARCHAR(2) DEFAULT '0';
ALTER TABLE `api_slide` ADD COLUMN `device_type` VARCHAR(2) DEFAULT '0';
ALTER TABLE `api_index_function` ADD COLUMN `device_type` VARCHAR(2) DEFAULT '0';
ALTER TABLE `api_gadget` ADD COLUMN `device_type` VARCHAR(2) DEFAULT '0';
ALTER TABLE `api_service_home_operation` ADD COLUMN `device_type` VARCHAR(2) DEFAULT '0';
ALTER TABLE `api_specialexterior` ADD COLUMN `device_type` VARCHAR(2) DEFAULT '0';
ALTER TABLE `api_gadget` ADD COLUMN `payment_type` VARCHAR(2) DEFAULT '0';
CREATE TABLE `api_indexfunctionregion` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `indexfunction_id` int(11) NOT NULL COMMENT '关联功能区入口配置',
  `region_id` int(11) NOT NULL COMMENT '关联大区入口配置',
  PRIMARY KEY (`id`),
  KEY `idx_region_id_refs_id` (`region_id`),
  KEY `idx_indexfunction_id_refs_id_c70d2bf3` (`indexfunction_id`),
  CONSTRAINT `idx_indexfunction_id_refs_id_c70d2bf3` FOREIGN KEY (`indexfunction_id`) REFERENCES `api_index_function` (`id`),
  CONSTRAINT `idx_region_id_refs_id` FOREIGN KEY (`region_id`) REFERENCES `api_region` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='固定模版展示大区';
CREATE TABLE `api_indexfunctioncity` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增主键id',
  `indexfunction_id` int(11) NOT NULL COMMENT '关联功能区入口配置',
  `city_id` varchar(40) NOT NULL COMMENT '关联功能区入口配置',
  PRIMARY KEY (`id`),
  KEY `idx_indexfunction_id_refs_id_4fc69f69` (`indexfunction_id`),
  KEY `idx_city_id_refs_id_990fd79f` (`city_id`),
  CONSTRAINT `idx_city_id_refs_id_990fd79f` FOREIGN KEY (`city_id`) REFERENCES `api_city` (`id`),
  CONSTRAINT `idx_indexfunction_id_refs_id_4fc69f69` FOREIGN KEY (`indexfunction_id`) REFERENCES `api_index_function` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='固定模版展示城市';
COMMIT;
