18 lines
442 B
Ruby
18 lines
442 B
Ruby
class CreateAddresses < 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 :addresses do |t|
|
|
t.column :street, :text
|
|
t.column :postal_code, :string
|
|
t.column :city, :string
|
|
t.column :country, :string
|
|
end
|
|
end
|
|
|
|
def self.down
|
|
drop_table :addresses
|
|
end
|
|
end
|