Skip to content

Instantly share code, notes, and snippets.

@criminy
Created November 30, 2011 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save criminy/1409272 to your computer and use it in GitHub Desktop.
Save criminy/1409272 to your computer and use it in GitHub Desktop.
Mockup of ActiveRecord-style using groovy/gradle style.
accounts = table("accounts")
migration("add_ssl") {
up {
add_column accounts "ssl_enabled" Fields.boolean {
defaults 1
}
}
down {
remove_column accounts "ssl_enabled"
}
}
migration("create_accounts") {
up {
create_table "accounts" {
string "name"
string "password"
}
}
down {
drop_table "accounts"
}
}
database {
name "asdf"
table_prefix = "tbl_"
migrations {
ref "create_accounts"
ref "add_ssl"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment