Permalink
Browse files

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

  • Loading branch information...
1 parent 8131235 commit 74fb9f9c030ff2844d602d7d403efe123a937f72 @tlberglund committed Mar 19, 2011
@@ -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)
}
@@ -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
@@ -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')
+ }
}
}

0 comments on commit 74fb9f9

Please sign in to comment.