Created
October 31, 2013 12:26
-
-
Save tcnksm/7248836 to your computer and use it in GitHub Desktop.
Create DB table by ActiveRecord::Migration
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
class CreateTable < ActiveRecord::Migration | |
def self.up | |
create_table :a_tables do |t| | |
t.column :name1, :integer, :null => false | |
t.column :name2, :text, :null => false | |
t.timestamps | |
end | |
end | |
def self.down | |
drop_table :a_tables | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment