jetsgit / spree_tax_cloud

Spree Interface for TaxCloud SOAP API
19 stars 32 forks source link

Error during migration: Index name too long #39

Closed wrydere closed 10 years ago

wrydere commented 11 years ago

While running the FixScaleOfCartItemPrices migration, I get the following error related to the length of the index name. I'm using the 2-0-stable branch, db is MySql.

==  FixScaleOfCartItemPrices: migrating =======================================
-- change_column(:spree_tax_cloud_cart_items, :price, :decimal, {:precision=>8, :scale=>2})
rake aborted!
An error has occurred, this and all later migrations canceled:

Index name 'temp_index_altered_spree_tax_cloud_cart_items_on_tax_cloud_transaction_id' on table 'altered_spree_tax_cloud_cart_items' is too long; the limit is 64 characters
/foo/db/migrate/20131017230448_fix_scale_of_cart_item_prices.spree_tax_cloud.rb:4:in `up'
Tasks: TOP => db:migrate
wrydere commented 11 years ago

Also, this may be worth mentioning: I tried to get around this by dropping my dev db, creating it fresh, and running all migrations, but am receiving the same error.

jetsgit commented 11 years ago

Looks like your problem is with MySQL generating an index name that is too long. Not sure why that is happening, but perhaps you could try manually creating the index in the migration.

wrydere commented 11 years ago

Thanks. Specifying a name for the long index name on line 19 of create_spree_tax_cloud_cart_items.spree_tax_cloud.rb allowed the migration to complete as expected.

add_index :spree_tax_cloud_cart_items, :tax_cloud_transaction_id, :name => 'tax_cloud_cart_trans_id'

However, I'm noticing that the cart total tax is only being calculated after the final order is submitted -- in other words, the customer can't see what tax they are being charged until the order is complete. Is that expected behavior, or might this have to do with the changes I made to the migration?

jetsgit commented 10 years ago

Please check to see if tax is still not showing up

jetsgit commented 10 years ago

No feedback in 5 months. Closing.