For some reason I have a Rails app that's running perfectly fine on one system at the moment, but I cannot seem to migrate the database migration files on another system that's trying to replicate the same thing.
Here's an example of the error that I'm getting:
== 20181024060925 CreateNetworkStalkerSubDomains: migrating ====================
-- create_table(:network_stalker_sub_domains) rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
Index name 'index_network_stalker_sub_domains_on_network_stalker_ip_address_id' on table 'network_stalker_sub_domains' is too long; the limit is 62 characters
And then here's the migration file
class CreateNetworkStalkerSubDomains < ActiveRecord::Migration[5.1]
def change
create_table :network_stalker_sub_domains do |t|
t.belongs_to :network_stalker_ip_address, foreign_key: true
t.string :name
t.timestamps
end
end
end
I have some joins tables that I fixed this issue by adding a name:
and unique:
parameter and it worked successfully, but I'm not quite sure how to fix this one.