farm_land_users.sql 1.2 KB

12345678910111213141516171819
  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 unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  8. `user_id` bigint NOT NULL COMMENT '用户ID',
  9. `position` tinyint unsigned NOT NULL COMMENT '土地位置(1-20)',
  10. `land_type` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '土地类型:1普通,2红土,3黑土,4金,5蓝,6紫',
  11. `status` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '土地状态:0空闲,1种植中,2灾害,3可收获,4枯萎',
  12. `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  13. `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  14. PRIMARY KEY (`id`) USING BTREE,
  15. UNIQUE KEY `idx_user_position` (`user_id`,`position`) USING BTREE,
  16. KEY `idx_user_id` (`user_id`) USING BTREE,
  17. KEY `idx_status` (`status`) USING BTREE
  18. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='土地信息表';