aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/invertible_migration_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Respect options passed to `foreign_key` when reverting `add_reference`Sean Griffin2016-05-311-0/+15
| | | | | | | | | | | | The code incorrectly assumes that the option was written as `foreign_key: true`, but that is not always the case. This now mirrors the behavior of reverting `add_foreign_key`. The code was changed to use kwargs while I was touching it, as well. This could really use a refactoring to go through the same code paths as `add_refernce` in the future, so we don't duplicate default values. Fixes #25169
* Remove legacy mysql adapterAbdelkader Boudih2015-12-171-1/+1
|
* Internal test migrations use the private 'Current' versionMatthew Draper2015-12-151-2/+2
| | | | | | | | Apart from specific versioning support, our tests should focus on the behaviour of whatever version they're accompanying, regardless of when they were written. Application code should *not* do this.
* Deprecate `#table_exists?`, `#tables` and passing arguments to `#talbes`yui-knk2015-11-091-23/+31
| | | | | | | | | | Reported on #21509, how views is treated by `#tables` are differ by each adapters. To fix this different behavior, after Rails 5.0 is released, deprecate `#tables`. And `#table_exists?` would check both tables and views. To make their behavior consistent with `#tables`, after Rails 5.0 is released, deprecate `#table_exists?`.
* Make revert of `disable_extension` to workyui-knk2015-08-301-0/+33
| | | | | | 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.
* Fix the unused variable warningakihiro172015-08-261-1/+0
| | | | | | | | This fixes the following warning. ```ruby warning: assigned but unused variable - index_definition ```
* Make `change_column_default` to workyui-knk2015-08-251-0/+33
| | | | | | | | | | | | 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
* make `remove_index :table, :column` reversible.Yves Senn2015-06-151-6/+10
| | | | | | | | | 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
* Silence another test that runs migrationsAkira Matsuda2014-08-291-0/+5
|
* Use teardown helper method.Guo Xiang Tan2014-03-141-1/+1
| | | | | | | | Follow-Up to https://github.com/rails/rails/pull/14348 Ensure that SQLCounter.clear_log is called after each test. This is a step to prevent side effects when running tests. This will allow us to run them in random order.
* Skip test_migrate_revert_add_index_with_name if databasesYasuo Honda2014-02-251-10/+13
| | | | do not allow to create duplicate indexes on the same columns
* Drop the correct index after reverting a migrationHubert Dąbrowski2014-02-131-0/+28
| | | | | | Previously when reverting a migration which added a named index it would instead drop a corresponding index with matching columns but without a name.
* fix failing test caused by 3771e4d511Neeraj Singh2013-05-061-2/+2
|
* raise IrreversibleMigration if no column givenNeeraj Singh2013-05-061-0/+28
| | | | | | | | | | | | | | | 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.
* Fixes for PR [#8267]Marc-Andre Lafortune2012-12-221-2/+4
| | | | | | | | * Fix Migration#reversible by not using `transaction`. * Adapt mysql adapter to updated api for remove_column * Update test after aedcd683684d08eaf30623a4b48ce31a31426372
* Make drop_table reversible [#8267]Marc-Andre Lafortune2012-12-211-3/+3
|
* Add Migration#reversible for reversible data operations [#8267]Marc-Andre Lafortune2012-12-211-0/+39
|
* Allow revert of whole migration [#8267]Marc-Andre Lafortune2012-12-211-0/+63
|
* Allow reverting of migration commands with Migration#revert [#8267]Marc-Andre Lafortune2012-12-211-0/+23
|
* migrate(:down) method with table_name_prefixkennyj2012-01-111-0/+12
|
* Ensure that .up and .down work as well.Christopher Meiklejohn2011-08-021-2/+13
|
* Support backwards compatible interface for migration down/up with rails 3.0.x.Christopher Meiklejohn2011-08-021-0/+24
|
* please use ruby -I lib:test path/to/test.rb, or export RUBY_OPTAaron Patterson2011-06-061-1/+1
|
* Refactor Active Record test connection setup. Please see the ↵Jon Leighton2011-06-041-1/+1
| | | | RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
* fisting typeo, thanks @vinibaggioAaron Patterson2010-11-191-1/+1
|
* fisting my spelling errorsAaron Patterson2010-11-191-0/+57