cours0708/P5B/ruby/mon_projet/db/migrate/003_create_customers.rb
2008-11-25 22:11:16 +01:00

16 lines
377 B
Ruby

class CreateCustomers < ActiveRecord::Migration
def self.up
db_name = ActiveRecord::Base::connection.current_database()
execute "ALTER DATABASE #{db_name} CHARACTER SET utf8 COLLATE utf8_general_ci"
create_table :customers do |t|
t.column :firstname, :string
t.column :name, :string
end
end
def self.down
drop_table :customers
end
end