Skip to content

Instantly share code, notes, and snippets.

@benjaminreid
Created April 15, 2015 14:42
Show Gist options
  • Save benjaminreid/8bfe81be40b3c115ed71 to your computer and use it in GitHub Desktop.
Save benjaminreid/8bfe81be40b3c115ed71 to your computer and use it in GitHub Desktop.
migration
(this will presume you have migrations table already created, e.g. CREATE TABLE schema_migrations (migrations TEXT);)
Migration 1.
key: foobar
up: CREATE TABLE table_name (column_1 INT); INSERT INTO schema_migrations (migrations) VALUES ('foobar');
down: DROP TABLE table_name; DELETE FROM schema_migrations WHERE migrations = 'foobar';
Migation 2.
....etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment