Created
July 10, 2012 18:43
-
-
Save ryanclark2/3085444 to your computer and use it in GitHub Desktop.
Migrate error
This file contains 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
$ rake db:migrate | |
== CreateWarehouseTransactionStateTransitions: migrating ===================== | |
-- create_table(:warehouse_transaction_state_transitions) | |
-> 0.0641s | |
-- add_index(:warehouse_transaction_state_transitions, :warehouse_transaction_id) | |
rake aborted! | |
An error has occurred, this and all later migrations canceled: | |
Index name 'index_warehouse_transaction_state_transitions_on_warehouse_transaction_id' on table 'warehouse_transaction_state_transitions' is too long; the limit is 63 characters | |
Tasks: TOP => db:migrate | |
(See full trace by running task with --trace) |
This file contains 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
#add name to index. | |
add_index :warehouse_transaction_state_transitions, :warehouse_transaction_id, :name =>'audit_index' |
This file contains 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
$ rake db:migrate | |
== CreateWarehouseTransactionStateTransitions: migrating ===================== | |
-- create_table(:warehouse_transaction_state_transitions) | |
NOTICE: CREATE TABLE will create implicit sequence "warehouse_transaction_state_transitions_id_seq" for serial column "warehouse_transaction_state_transitions.id" | |
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "warehouse_transaction_state_transitions_pkey" for table "warehouse_transaction_state_transitions" | |
-> 0.0097s | |
-- add_index(:warehouse_transaction_state_transitions, :warehouse_transaction_id, {:name=>"audit_index"}) | |
-> 0.0107s | |
== CreateWarehouseTransactionStateTransitions: migrated (0.0210s) ============ |
This file contains 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
. | |
. | |
. | |
state_machine :state, :initial => :incoming do | |
store_audit_trail :to => 'WarehouseTransactionStateTransition' | |
. | |
. | |
. |
This file contains 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 WarehouseTransactionStateTransition < ActiveRecord::Base | |
belongs_to :warehouse_transaction | |
attr_accessible :created_at, :event, :from, :to | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does adding a name to the index break the audit trail? Doesn't seem to be logging for me.