Skip to content

Instantly share code, notes, and snippets.

@sagrawal31
Created May 9, 2019 10:45
Show Gist options
  • Save sagrawal31/305e7e2fbcb26c3634014f6d80f80f5c to your computer and use it in GitHub Desktop.
Save sagrawal31/305e7e2fbcb26c3634014f6d80f80f5c to your computer and use it in GitHub Desktop.
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