在liquibase中插入变更集无效
我开始在我的spring启动代码中集成liquibase脚本。现在我只有2个变更集,我的liquibase脚本如下:在liquibase中插入变更集无效,liquibase,Liquibase,我开始在我的spring启动代码中集成liquibase脚本。现在我只有2个变更集,我的liquibase脚本如下: databaseChangeLog: - changeSet: id: liquibase-create-1 author: liquibase preConditions: onFail: MARK_RAN not: sequenceExists: sequenceName: APP_USER_
databaseChangeLog:
- changeSet:
id: liquibase-create-1
author: liquibase
preConditions:
onFail: MARK_RAN
not:
sequenceExists:
sequenceName: APP_USER_SEQ
changes:
- createSequence:
sequenceName: APP_USER_SEQ
startValue: 1
minValue: 1
incrementBy: 1
- changeSet:
id: liquibase-create-2
author: liquibase
preCondition:
onFail: MARK_RAN
not:
tableExists:
tableName: APP_USER
changes:
-createTable:
tableName: APP_USER
columns:
- column:
name: ID
constraints:
primaryKey: true
nullable: false
primaryKeyName: APP_USER_PK
type: INTEGER
- column:
name: VERSION
type: INTEGER
- column:
name: USER_ID
constraints:
nullable: false
type: VARCHAR(50)
- column:
name: USER_TYPE
constraints:
nullable: false
type: INTEGER
- column:
name: PASSWORD
constraints:
nullable: false
type: VARCHAR(50)
- column:
name: FIRST_NM
constraints:
nullable: false
type: VARCHAR(50)
- column:
name: LAST_NM
constraints:
nullable: false
type: VARCHAR(50)
- column:
name: DISPLAY_NM
constraints:
nullable: false
type: VARCHAR(50)
- column:
name: DEPARTMENT
constraints:
nullable: false
type: VARCHAR(50)
- column:
name: EMAIL_ID
constraints:
nullable: false
type: VARCHAR(50)
- column:
name: PHONE_NO
constraints:
nullable: false
type: VARCHAR(50)
- column:
name: LOCATION
constraints:
nullable: false
type: VARCHAR(50)
当应用程序以平稳的方式启动时,我遇到了一个奇怪的行为,即只有序列成功创建,但在我的模式中没有表app_用户。
日志也支持我的观察:
2020-09-09 23:09:57.992 INFO 6680 --- [ main] liquibase
: classpath:/db/changelog/db.changelog-master.yaml:
db/changelog/changes/db.changelog-create-v1.yml::liquibase-create-1::liquibase:
Sequence APP_USER_SEQ created 2020-09-09 23:09:57.993 INFO 6680 --- [
main] liquibase :
classpath:/db/changelog/db.changelog-master.yaml:
db/changelog/changes/db.changelog-create-v1.yml::liquibase-create-1::liquibase:
ChangeSet
db/changelog/changes/db.changelog-create-v1.yml::liquibase-create-1::liquibase
ran successfully in 36ms 2020-09-09 23:09:58.020 INFO 6680 --- [
main] liquibase :
classpath:/db/changelog/db.changelog-master.yaml:
db/changelog/changes/db.changelog-create-v1.yml::liquibase-create-2::liquibase:
ChangeSet
db/changelog/changes/db.changelog-create-v1.yml::liquibase-create-2::liquibase
ran successfully in 0ms
确切地说,它说liquibase-create-2在0毫秒内成功运行
有人能帮忙解决问题吗?是缩进问题。在以下方面工作良好:
- changeSet:
id: liquibase-create-2
author: liquibase
preCondition:
onFail: MARK_RAN
not:
tableExists:
tableName: APP_USER
changes:
- createTable:
tableName: APP_USER
columns:
- column:
name: ID
constraints:
primaryKey: true
nullable: false
primaryKeyName: APP_USER_PK
type: INTEGER
- column:
name: VERSION
type: INTEGER
- column:
name: USER_ID
constraints:
nullable: false
type: VARCHAR(50)
- column:
name: USER_TYPE
constraints:
nullable: false
type: INTEGER
- column:
name: PASSWORD
constraints:
nullable: false
type: VARCHAR(50)
- column:
name: FIRST_NM
constraints:
nullable: false
type: VARCHAR(50)
- column:
name: LAST_NM
constraints:
nullable: false
type: VARCHAR(50)
- column:
name: DISPLAY_NM
constraints:
nullable: false
type: VARCHAR(50)
- column:
name: DEPARTMENT
constraints:
nullable: false
type: VARCHAR(50)
- column:
name: EMAIL_ID
constraints:
nullable: false
type: VARCHAR(50)
- column:
name: PHONE_NO
constraints:
nullable: false
type: VARCHAR(50)
- column:
name: LOCATION
constraints:
nullable: false
type: VARCHAR(50)