Skip to content

Commit

Permalink
fix(sql): Fix migrations for users who do not run MySQL (#3721)
Browse files Browse the repository at this point in the history
  • Loading branch information
robzienert committed Jun 4, 2020
1 parent 622d37a commit 7465896
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
3 changes: 3 additions & 0 deletions orca-sql/src/main/resources/db/changelog-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ databaseChangeLog:
- include:
file: changelog/20200424-index-deleted-executions-table.yml
relativeToChangelogFile: true
- include:
file: changelog/20200603-deleted-executions-table-not-mysql.yml
relativeToChangelogFile: true
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ databaseChangeLog:
author: mvulfson
changes:
- createIndex:
dbms: mysql
indexName: deleted_at_idx
tableName: deleted_executions
columns:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
databaseChangeLog:
- changeSet:
id: create-deleted-executions-table-for-not-mysql
author: robzienert
preConditions:
onFail: MARK_RAN
not:
tableExists:
tableName: deleted_executions
changes:
- createTable:
tableName: deleted_executions
columns:
- column:
name: id
type: int
constraints:
primaryKey: true
nullable: false
- column:
name: execution_id
type: char(26)
constraints:
nullable: false
- column:
name: execution_type
type: varchar(15)
constraints:
nullable: false
- column:
name: deleted_at
type: datetime
constraints:
nullable: false
- addAutoIncrement:
tableName: deleted_executions
columnName: id
columnDataType: int

rollback:
- dropTable:
tableName: deleted_executions
- changeSet:
id: create-deleted-executions-index-for-not-mysql
author: robzienert
preConditions:
onFail: MARK_RAN
not:
indexExists:
indexName: deleted_at_idx
changes:
- createIndex:
indexName: deleted_at_idx
tableName: deleted_executions
columns:
- column:
name: deleted_at
rollback:
- dropIndex:
indexName: deleted_at_idx
tableName: deleted_executions

0 comments on commit 7465896

Please sign in to comment.