Files
lgp-admin-plus-api/.cursor/rules/Database-SQL.mdc
LQ 11f40a75e4 初始化
缺陷:主题配色需要优化整体的同风格
2026-08-14 23:21:37 +08:00

28 lines
831 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
description: 数据库变更一律走按日 SQL 目录,禁止新建 PHP Migration
alwaysApply: true
---
# 数据库变更约定lgp-admin-plus-api
## 强制
- **禁止**为表结构变更新建 `database/migrations/*.php`
- **一律**落在:
```
database/sql/<YYYY-MM-DD>/01_简短英文名.sql
database/sql/<YYYY-MM-DD>/02_....sql
```
- 当天目录不存在则新建;序号从 `01` 递增
- 脚本尽量幂等(查 `information_schema` + `PREPARE`
- 系统表(`nl_*`)若影响全新安装:同步改 `public/nl_admin.sql`
- 业务表(`cc_*`):只写 `database/sql/`**不进** `nl_admin.sql`
- 上线由运维在目标库手工执行对应日期目录下的 SQL
## 反例
- `php artisan make:migration add_xxx_to_yyy` → 不要
- 把 DDL 塞进 Seeder / 业务代码里临时跑 → 不要