-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails 4.2, MySQL: cannot use 't.references' in migration #629
Labels
Comments
akarazniewicz
pushed a commit
to akarazniewicz/activerecord-jdbc-adapter
that referenced
this issue
Mar 15, 2015
kares
pushed a commit
that referenced
this issue
Apr 2, 2015
should be fixed now on 1-3-stable with #631 in place ... feel free to re-open if not, thanks! |
kares
added a commit
that referenced
this issue
Jun 12, 2015
kares
added a commit
that referenced
this issue
Jun 13, 2015
* 1-3-stable: (43 commits) one last place of missed shared AR4x constants refactoring (thanks travis-ci!) missed places for updating to using shared AR4x constants use the (shared) AR4x constants in PostgreSQL adapter move AR4x constants to (top-level) ArJdbc adapt schema dump test on AR 4.2 ... *t.string \"id\", limit: 255, null: false* now [mysql] bulk compatibility with AR 4.2 - all _sql helper accept an options (hash) [mysql] back-port case sensitive/insensitive comparison [mysql] handle precision for datetimes when doing type_to_sql (AR 4.2 compat) adjust foreign key test introduced in #629 (was failing with MRI under AR 4.2.1) [mysql] schema creation compatibility with AR 4.2 (drop FK & temporayr tables) [mysql] validate_index_length! when available [mysql] foreign key support based on AR 4.2 (fixes #656) review foreign_key support in Postgres adapter (extract helper should be private) AR 4.2 valid_type? method for all finish up the foreign key test - more asserts less puts [postgres] drop_table backported to support `:force => :cascade` option [postgres] foreign_key support back-ported from AR 4.2 (fixes #656) [postgres] primary_key compatibility with latest AR export `open?` and ("raw") `close` helpers on the JDBC connection side alias jdbc_connection active? as valid? (just so its clearer on what it does) ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So I generated a Rails migration using the 'references' keyword to create the association between model First and Second. I called:
And I got this:
It fails like so:
It fails before the add_foreign_key call, complaining that the
Index name 'index_seconds_on_first_id' on table 'seconds' already exists
. The current walkaround is to remove thet.references
call and replace it byadd_reference :seconds, :first, index: true
outside ofcreate_table
. So what is going on, why is t.references creating the index twice?Also, the add_foreign_key method doesn't do anything at the moment.
The text was updated successfully, but these errors were encountered: