farm_land_users.sql 1.3 KB

1234567891011121314151617181920
  1. -- ******************************************************************
  2. -- 表 kku_farm_land_users 的创建SQL
  3. -- 对应的Model: App\Module\Farm\Models\FarmLand
  4. -- 警告: 此文件由系统自动生成,禁止修改!
  5. -- ******************************************************************
  6. CREATE TABLE `kku_farm_land_users` (
  7. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  8. `user_id` bigint(20) NOT NULL COMMENT '用户ID',
  9. `position` tinyint(3) unsigned NOT NULL COMMENT '土地位置(1-20)',
  10. `land_type` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '土地类型:1普通,2红土,3黑土,4金,5蓝,6紫',
  11. `status` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '土地状态:0空闲,1种植中,2灾害,3可收获,4枯萎',
  12. `has_crop` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否有作物:0无,1有',
  13. `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  14. `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  15. PRIMARY KEY (`id`) USING BTREE,
  16. UNIQUE KEY `idx_user_position` (`user_id`,`position`) USING BTREE,
  17. KEY `idx_user_id` (`user_id`) USING BTREE,
  18. KEY `idx_status` (`status`) USING BTREE
  19. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='土地信息表';