| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | | |
[ci skip] Update what methods `Migration#change` can reverse
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* Documentations and comments about what methods
`Migration#change` can reverse is out of date.
For example `change_column_default` is now reversible
by this [commit](https://github.com/rails/rails/pull/20018).
* Comments about `CommandRecorder` dose not match with Rails Guide.
For example `add_foreign_key` is listed only on Rails Guide.
|
|\ \ \
| |/ /
|/| | |
Make revert of `disable_extension` to work
|
| |/
| |
| |
| |
| |
| | |
This is fix of #11826 which miss to add `disable_extension` to
`ReversibleAndIrreversibleMethods`. So `CommandRecorder#method_missing`
catches `change_column_default` and @delegate's method is called.
|
|\ \
| |/
|/| |
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
| |
This is fix of #20018 which removes `change_column_default` from
array, so `CommandRecorder#method_missing` catches
`change_column_default` and @delegate's method is called.
This PR
* fix this bug
* define `ReversibleAndIrreversibleMethods` const making clear
which this array means to prevent these miss
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Passing `:from` and `:to` to `change_column_default` makes this command
reversible as user has defined its previous state.
So, instead of having the migration command as:
change_column_default(:posts, :state, "draft")
They can write it as:
change_column_default(:posts, :state, from: nil, to: "draft")
|
|
|
|
|
|
|
|
|
| |
This used to raise a `IrreversibleMigration` error (since #10437).
However since `remove_index :table, :column` is probably the most basic
use-case we should make it reversible again.
Conflicts:
activerecord/CHANGELOG.md
|
| |
|
|\
| |
| | |
Added documentation for change_table
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Before this change, create_join_table would not remove the common prefix
in the join table name, unlike ActiveRecord::Reflections. A HABTM
between Music::Artist and Music::Record would use a table
music_artists_records, while create_join table would create
music_artists_music_records.
|
| | |
|
| |
| |
| |
| | |
This allows to create and remove foreign keys without specifying a column.
|
|/ |
|
|
|
|
|
|
| |
Previously when reverting a migration which added a named index it
would instead drop a corresponding index with matching columns but
without a name.
|
|
|
|
| |
Closes #13623.
|
|
|
|
|
|
|
|
|
| |
- Earlier, change_table was creating database-agnostic object.
- After this change, it will create correct object based on current
database adapter.
- This will ensure that create_table and change_table will get same objects.
- This makes update_table_definition method public and nodoc.
- Fixes #13577 and #13503
|
|
|
|
|
| |
If 'enable_extension' is used in a migration's 'change' method, use
'disable_extension' on down migration (and vice-versa).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #10419
Following code should raise IrreversibleMigration. But the code was
failing since options is an array and not a hash.
def change
change_table :users do |t|
t.remove_index [:name, :email]
end
end
Fix was to check if the options is a Hash before operating on it.
|
|
|
|
|
|
|
|
| |
* Fix Migration#reversible by not using `transaction`.
* Adapt mysql adapter to updated api for remove_column
* Update test after aedcd683684d08eaf30623a4b48ce31a31426372
|
| |
|
|
|
|
| |
[#8267]
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
reversible.
[#8267]
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
If you accidentally pass a string and a symbol, this breaks. So
we coerce them both to strings.
Fixes #7715
|
|
|
|
|
| |
Lets stick with a symbol in join table name, it was removed in
993e1643650b7b0939437f86b7b4cda0d92b0b8f and broke the build.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For instance, running
rails g migration CreateMediaJoinTable artists musics:uniq
will create a migration with
create_join_table :artists, :musics do |t|
# t.index [:artist_id, :music_id]
t.index [:music_id, :artist_id], unique: true
end
|
| |
|
| |
|
| |
|
|
|
|
| |
ActiveRecord::Migration::CommandRecorder#invert_rename_index
|
|\ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
change method"
This reverts commit 7f91eebae361f2f3a1558f6d899b372524509a2d.
Reason: Incorrect documenting. The newly added methods to the list are
not actually supported by reversible migrations.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The changes broke bulk migration tests and were fixed in 4d256bc6;
however that brought back the issue of #1857 and so this commit goes
back to the original scenario and just adds change_table to the list
of methods which are to be recorded in the CommandRecorder. The
method_missing now delegates all calls to the underlying connection as
before.
|
| |
| |
| |
| | |
tests in migration_test.rb under mysql. The problem was introduced in c278a2c5e109204ec8a47fcbfdfc327aad7996ce.
|