Created
May 9, 2019 10:45
-
-
Save sagrawal31/305e7e2fbcb26c3634014f6d80f80f5c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import liquibase.statement.core.* | |
import com.some.domain.Post | |
databaseChangeLog = { | |
// Auto generated change sets which adds column to the post table. | |
grailsChange { | |
change { | |
Post.list().each { postInstance -> | |
postInstance.dateCreated = new Date() | |
postInstance.lastUpdated = new Date() | |
postInstance.isActive = true | |
postInstance.save(failOnError: true, flush: true) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment