Unverified Commit 804bf25f authored by Zzm0809's avatar Zzm0809 Committed by GitHub

Modify the naming convention for upgrade files (#3631)

parent 39001af2
......@@ -25,7 +25,7 @@ spring:
table: _dinky_flyway_schema_history
placeholder-replacement: false # Placeholder Replacement
baseline-on-migrate: true # Baseline during migration
baseline-version: 1.0.2 # Baseline version
baseline-version: 20240506.1.0.2 # Baseline version
validate-on-migrate: false # Verify during migration
placeholder-prefix: '##{'
placeholder-suffix: '}##'
......
......@@ -8,17 +8,17 @@
## 数据库脚本规则
- V 开头的代表发布版本; 规则: `V{版本号}__{描述}.sql`
- R 开头的代表回滚版本; 规则: `R{版本号}__{描述}.sql`
- V 开头的代表发布版本; 规则: `V{日期}.{版本号}__{描述}.sql`
- R 开头的代表回滚版本; 规则: `R{日期}.{版本号}__{描述}.sql`
## 命名规则
- V{版本号}__{描述}.sql eg: V1.0.2__release.sql
- R{版本号}__{描述}.sql eg: R1.0.2__release.sql
- V{日期}.{版本号}__{描述}.sql eg: V20240708.1.1.0__release.sql
- R{日期}.{版本号}__{描述}.sql eg: R20240708.1.1.0__release.sql
**注意:**
- V{版本号}__{描述}.sql 中间是**两个下划线**,固定规则,不符合规则将无法执行
- 每个版本只能有一个 V{版本号}__{描述}.sql 文件,否则将无法执行, 不管是 DDL 还是 DML 统一放在一个文件中
- V{日期}.{版本号}__{描述}.sql 中间是**两个下划线**,固定规则,不符合规则将无法执行
- 由于某一个版本发布可能会有多个脚本文件,所以版本号不能重复,因此在命名方式上将采用 `V{日期}.{版本号}__描述.sql` 规则,如: `V20240708.1.1.0__release.sql`, 注意日期格式为 `yyyyMMdd`,采用此方式可以避免版本号重复,造成开发者的开发工作会混乱,造成版本管理混乱,造成版本迭代不方便
......@@ -45,17 +45,16 @@
- Must have MySQL/postgreSQL connection driver
## Database Script Rules
- V represents the released version; Rule: `V{Version Number}__{Description}.SQL`
- R represents the rolled back version; Rule: `R{Version Number}__{Description}.SQL`
- V represents the released version; Rule: `V{date}.{Version Number}__{Description}.SQL`
- R represents the rolled back version; Rule: `R{date}.{Version Number}__{Description}.SQL`
## Naming rules
- V{version number}__{description}.sql eg: V1.0.2__release.sql
- R{version number}__{description}.sql eg: R1.0.2__release.sql
- V{date}.{Version Number}__{description}.sql eg: V20240708.1.1.0__release.sql
- R{date}.{Version Number}__{description}.sql eg: R20240708.1.1.0__release.sql
**Attention:**
- V{version number}__{description}.SQL has two underscores in the middle, which are fixed rules. If they do not comply with the rules, they cannot be executed
- Each version can only have one V{version number}__{description}.sql file, otherwise it will not be executed, whether it is DDL or DML, it will be placed in one file
- V{date}.{version number}__{description}.SQL has two underscores in the middle, which are fixed rules. If they do not comply with the rules, they cannot be executed
- Due to the possibility of multiple script files for a certain version release, the version number cannot be duplicated. Therefore, the naming convention will use `V{date}.{Version Number}__Description.sql` Rule, such as `V20240708.1.1.0_ release. SQL`, please note that the date format is `yyyyMMdd`. This method can avoid duplicate version numbers, which can cause confusion in developer development work, version management, and inconvenient version iteration
**Upgrade script considerations:**
- If you need to add fields to a table, do not use the 'alter table add column' statement. Instead, use the following statement:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment