Skip to content

Commit 2bfc041

Browse files
committed
Tag and add a groovy script for migration
1 parent c8ebd77 commit 2bfc041

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

Diff for: src/main/migrations/add-fullname-to-contact.groovy

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
databaseChangeLog {
2+
changeSet(author: "neodevelop", id: "202006152000-21"){
3+
addColumn(tableName: "contact"){
4+
column(name: "full_name", afterColumn: "surname", type: "varchar(255)")
5+
}
6+
rollback {
7+
dropColumn(columnName: "full_name", tableName: "contact")
8+
}
9+
}
10+
changeSet(author: "neodevelop", id: "202006152000-22"){
11+
sql """
12+
update contact set full_name=concat_ws(' ', givenname, middleinitial, surname);
13+
"""
14+
rollback()
15+
}
16+
}

Diff for: src/main/migrations/master-changelog.groovy

+4
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@ databaseChangeLog {
1212
}
1313
include file: "src/main/migrations/relation-tables.xml"
1414
include file: "src/main/migrations/migrate-data.xml"
15+
changeSet(author: "neodevelop", id: "2020152000-20") {
16+
tagDatabase(tag: "version_1.2")
17+
}
18+
include file: "src/main/migrations/add-fullname-to-contact.groovy"
1519
}

0 commit comments

Comments
 (0)