You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rake attachinary:install:migrations -> Index table names are too long #154
After running rake attachinary:install:migrations I get the following output
WARNING: Use strings for Figaro configuration. 587 was converted to "587".
== 20171127085142 CreateAttachinaryTables: migrating ==========================
-- create_table(:attachinary_files)
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
Index name 'index_attachinary_files_on_attachinariable_type_and_attachinariable_id' on table 'attachinary_files' is too long; the limit is 63 characters
The fix is to add an own index name to the attachinariable reference. t.references :attachinariable, polymorphic: true, index: {name: "index_attachinary_files_attachinariable"}. Also note that I added [5.1] to the ActiveRecord::Migration Class because it was missing. (I am running Rails 5.1 so add your version)
Activity
mklb commentedon Nov 27, 2017
The fix is to add an own index name to the attachinariable reference.
t.references :attachinariable, polymorphic: true, index: {name: "index_attachinary_files_attachinariable"}. Also note that I added[5.1]to the ActiveRecord::Migration Class because it was missing. (I am running Rails 5.1 so add your version)lopezjurip commentedon Dec 10, 2017
Thanks @mklb