CREATE TABLE `qimall_addons_area_community` (
    `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
    `status` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
    `created_at` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建时间',
    `updated_at` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '修改时间',
    `mall_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '所属商城',
    `community_name` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '小区名称' COLLATE 'utf8mb4_general_ci',
    `province_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '身份ID',
    `city_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '城市ID',
    `district_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '地区ID',
    `town_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '乡镇ID',
    `lat` DECIMAL(9,6) NOT NULL DEFAULT '0.000000' COMMENT '纬度',
    `lng` DECIMAL(9,6) NOT NULL DEFAULT '0.000000' COMMENT '经度',
    `fully_address` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '完整地址' COLLATE 'utf8mb4_general_ci',
    `street` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '街道地址' COLLATE 'utf8mb4_general_ci',
    `area` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '省市区' COLLATE 'utf8mb4_general_ci',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `mall_id` (`mall_id`, `status`) USING BTREE
)
    COMMENT='小区'
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
AUTO_INCREMENT=1
;

ALTER TABLE `qimall_addons_area_agent`
    ADD COLUMN `community_id` INT(11) NOT NULL DEFAULT '0' COMMENT '小区ID' AFTER `town_id`;
ALTER TABLE `qimall_addons_area_apply`
    ADD COLUMN `community_id` INT(11) NOT NULL DEFAULT '0' COMMENT '小区ID' AFTER `town_id`;
