Created
April 24, 2012 08:19
-
-
Save nlinker/2477809 to your computer and use it in GitHub Desktop.
Liquibase example
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
databaseChangeLog() { | |
changeSet(id: "my first changeset", author: "daniel") { | |
comment('A comment') | |
createTable(tableName: 'my_table') { | |
column(name: 'id', type: 'uuid', defaultValue: 'uuid_generate_v4()') { | |
constraints(primaryKey: true, nullable: false) | |
} | |
column(name: 'name', type: 'character varying(100)') { | |
constraints(nullable: false) | |
} | |
column(name: 'active', type: 'boolean') { | |
constraints(nullable: false) | |
} | |
} | |
createIndex(indexName: 'idx_name', tableName: 'my_table') { | |
column(name: 'name') | |
} | |
rollback() { | |
dropTable(tableName: 'my_table') | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment