Created
June 7, 2011 12:54
-
-
Save edzhelyov/1012178 to your computer and use it in GitHub Desktop.
Sequel migration helpers
This file contains hidden or 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
module Helper | |
def create_product(name) | |
create_table name do | |
primary_key :id | |
String :name, :null => false | |
end | |
end | |
end | |
Sequel.migration do | |
up do | |
create_product :laptops | |
end | |
down do | |
drop_table :laptops | |
end | |
end | |
# Error: NoMethodError: undefined method `create_product' for #<Sequel::Postgres::Database: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment