works with sqlite3 for local developer. Prod DB - MySql.
Have a migration file to modify the column.
class ChangeDateToOrders < ActiveRecord::Migration def self.up change_column(:orders, :closed_date, :datetime) end def self.down change_column(:orders, :closed_date, :date) end end
Errors index name 'temp_index_altered_orders_on_closed_location_id_and_parent_company_id' on table 'altered_orders' is too long; the limit is 64 characters index name 'temp_index_altered_orders_on_closed_location_id_and_parent_company_id' on table 'altered_orders' is too long; the limit is 64 characters
Know there is a restriction on the index name with sqlite, but is there a workaround for this?
EDIT The workaround I used.
class ChangeDateToOrders < ActiveRecord::Migration def self.up remove_index(:orders, [:closed_location_id, :parent_company_id]) change_column(:orders, :closed_date, :datetime) add_index(:orders, [:closed_location_id, :parent_company_id], :name => "add_index_to_orders_cli_pci") end def self.down remove_index(:orders, :name => "add_index_to_orders_cli_pci") change_column(:orders, :closed_date, :date) add_index(:orders, [:closed_location_id, :parent_company_id]) end end
pcasa
source share