Skip to content

Instantly share code, notes, and snippets.

@Phrogz
Created August 31, 2011 18:57
Show Gist options
  • Save Phrogz/1184389 to your computer and use it in GitHub Desktop.
Save Phrogz/1184389 to your computer and use it in GitHub Desktop.
Sequel migration
Sequel.migration do
up do
create_table :customers do
primary_key :id
column :name, :varchar, size:60, null:false
column :organization, :varchar, size:60, null:false
column :email, :varchar, size:60
column :subscribed, :boolean, default:false, null:false
column :extra_str, :varchar, size:60
column :extra_int, :integer
end
end
down do
drop_table :customers
end
end
@Phrogz
Copy link
Author

Phrogz commented Aug 31, 2011

Run the migration with

sequel -m . sqlite://foo.db

where . means "look in the current directory for migration files".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment