mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-14 03:05:59 -04:00
Fix string/integer conversions in migrations.
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
class ChangeOrderMemberIdToInteger < ActiveRecord::Migration
|
||||
def change
|
||||
change_column :orders, :member_id, :integer
|
||||
def up
|
||||
remove_column :orders, :member_id
|
||||
add_column :orders, :member_id, :integer
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :orders, :member_id
|
||||
add_column :orders, :member_id, :string
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
class ChangeFlickrPhotoIdToString < ActiveRecord::Migration
|
||||
def up
|
||||
change_column :photos, :flickr_photo_id, :string
|
||||
remove_column :photos, :flickr_photo_id
|
||||
add_column :photos, :flickr_photo_id, :string
|
||||
end
|
||||
def down
|
||||
# Postgres doesn't allow you to cast strings to integers
|
||||
# Hence there's no way of rolling back this migration without losing
|
||||
# information.
|
||||
remove_column :photos, :flickr_photo_id
|
||||
change_column :photos, :flickr_photo_id, :integer
|
||||
end
|
||||
end
|
||||
|
||||
@@ -147,10 +147,10 @@ ActiveRecord::Schema.define(:version => 20130601011725) do
|
||||
end
|
||||
|
||||
create_table "orders", :force => true do |t|
|
||||
t.integer "member_id", :limit => 255, :null => false
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.datetime "completed_at"
|
||||
t.integer "member_id"
|
||||
t.string "paypal_express_token"
|
||||
t.string "paypal_express_payer_id"
|
||||
end
|
||||
@@ -162,7 +162,6 @@ ActiveRecord::Schema.define(:version => 20130601011725) do
|
||||
|
||||
create_table "photos", :force => true do |t|
|
||||
t.integer "owner_id", :null => false
|
||||
t.string "flickr_photo_id", :null => false
|
||||
t.string "thumbnail_url", :null => false
|
||||
t.string "fullsize_url", :null => false
|
||||
t.datetime "created_at", :null => false
|
||||
@@ -171,6 +170,7 @@ ActiveRecord::Schema.define(:version => 20130601011725) do
|
||||
t.string "license_name", :null => false
|
||||
t.string "license_url"
|
||||
t.string "link_url", :null => false
|
||||
t.string "flickr_photo_id"
|
||||
end
|
||||
|
||||
create_table "photos_plantings", :id => false, :force => true do |t|
|
||||
|
||||
Reference in New Issue
Block a user