Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed https://github.com/tlberglund/groovy-liquibase/issues#issue/11

  • Loading branch information...
commit 74fb9f9c030ff2844d602d7d403efe123a937f72 1 parent 8131235
@tlberglund authored
View
3  src/main/groovy/com/augusttechgroup/liquibase/delegate/ChangeSetDelegate.groovy
@@ -51,6 +51,7 @@ import liquibase.change.core.ExecuteShellCommandChange
import liquibase.change.custom.CustomChangeWrapper
import liquibase.exception.RollbackImpossibleException
import liquibase.change.core.ModifyDataTypeChange
+import liquibase.change.core.DeleteDataChange
class ChangeSetDelegate {
@@ -299,7 +300,7 @@ class ChangeSetDelegate {
void delete(Map params, Closure closure) {
- def change = makeColumnarChangeFromMap(UpdateDataChange, closure, params, ['schemaName', 'tableName'])
+ def change = makeColumnarChangeFromMap(DeleteDataChange, closure, params, ['schemaName', 'tableName'])
addChange(change)
}
View
3  ...st/groovy/com/augusttechgroup/liquibase/delegate/NonRefactoringTransformationTests.groovy
@@ -22,6 +22,7 @@ import liquibase.change.core.UpdateDataChange
import liquibase.change.core.TagDatabaseChange
import liquibase.change.core.StopChange
import liquibase.resource.FileSystemResourceAccessor
+import liquibase.change.core.DeleteDataChange
class NonRefactoringTransformationTests
@@ -320,7 +321,7 @@ class NonRefactoringTransformationTests
def changes = changeSet.changes
assertNotNull changes
assertEquals 1, changes.size()
- assertTrue changes[0] instanceof UpdateDataChange
+ assertTrue changes[0] instanceof DeleteDataChange
assertEquals 'monkey', changes[0].tableName
assertEquals 'schema', changes[0].schemaName
assertEquals "emotion='angry' AND active=true", changes[0].whereClause
View
9 test/test.groovy
@@ -1,6 +1,6 @@
databaseChangeLog() {
- include(path: 'changelogs')
+// include(path: 'changelogs', relativeToChangelog: true)
changeSet(id:'monkey', author: 'tlberglund') {
@@ -23,7 +23,12 @@ databaseChangeLog() {
column(name: 'id', type: "NUMERIC")
column(name: 'mood', type: "STRING")
}
-
+ }
+
+ changeSet(author: 'tlberglund', id: 'test-delete-data') {
+ delete(tableName: 'monkey') {
+ where('id=2')
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.