aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/migration/command_recorder.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add an invert method for remove_foreign_keyAster Ryan2015-06-111-0/+10
|
* Merge pull request #16305 from tomkadwill/documented_change_tableRafael Mendonça França2014-07-281-1/+1
|\ | | | | Added documentation for change_table
| * Added nodoc to change_tableTom Kadwill2014-07-281-1/+1
| |
* | fk: review corrections: indent, visibility, syntax, wording.Yves Senn2014-06-261-3/+3
| |
* | fk: infere column name from table names.Yves Senn2014-06-261-1/+3
| | | | | | | | This allows to create and remove foreign keys without specifying a column.
* | fk: make `add_foreign_key` reversible.Yves Senn2014-06-261-1/+16
|/
* Drop the correct index after reverting a migrationHubert Dąbrowski2014-02-131-1/+6
| | | | | | Previously when reverting a migration which added a named index it would instead drop a corresponding index with matching columns but without a name.
* make `change_column_null` reversible. Closes #13576.Yves Senn2014-01-081-1/+6
| | | | Closes #13623.
* Make change_table use object of current database adapterNishant Modak2014-01-071-4/+6
| | | | | | | | | - 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
* Make 'enable_extension' revertibleEric Tipton2013-08-101-1/+2
| | | | | If 'enable_extension' is used in a migration's 'change' method, use 'disable_extension' on down migration (and vice-versa).
* raise IrreversibleMigration if no column givenNeeraj Singh2013-05-061-1/+4
| | | | | | | | | | | | | | | 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-1/+2
| | | | | | | | * Fix Migration#reversible by not using `transaction`. * Adapt mysql adapter to updated api for remove_column * Update test after aedcd683684d08eaf30623a4b48ce31a31426372
* Remove duplicated methods in command recorder and duplicated test nameCarlos Antonio da Silva2012-12-211-3/+3
|
* Make execute, change_column and remove_columns methods actually irreversibleMarc-Andre Lafortune2012-12-211-1/+2
| | | | [#8267]
* Make change_table reversible when possible [#8267]Marc-Andre Lafortune2012-12-211-1/+5
|
* Factorize methods that are easily reversible [#8267]Marc-Andre Lafortune2012-12-211-34/+20
|
* Make remove_index reversible [#8267]Marc-Andre Lafortune2012-12-211-4/+10
|
* Differentiate between remove_column and remove_columns. Make remove_column ↵Marc-Andre Lafortune2012-12-211-2/+7
| | | | | | reversible. [#8267]
* Make drop_table reversible [#8267]Marc-Andre Lafortune2012-12-211-3/+10
|
* Add drop_join_table [#8267]Marc-Andre Lafortune2012-12-211-3/+6
|
* Add Migration#reversible for reversible data operations [#8267]Marc-Andre Lafortune2012-12-211-1/+5
|
* Allow reverting of migration commands with Migration#revert [#8267]Marc-Andre Lafortune2012-12-211-17/+36
|
* Split ridiculously long lineMarc-Andre Lafortune2012-12-211-1/+4
|
* Make references statements reversibleAleksey Magusev2012-07-031-1/+13
|
* Add `create_join_table` migration helper to create HABTM join tablesRafael Mendonça França2012-01-271-2/+10
|
* Fix GH #4285. Remove options when we record calling creat_tablekennyj2012-01-041-1/+1
|
* Fixed bad options order in ↵jbbarth2011-08-281-1/+1
| | | | ActiveRecord::Migration::CommandRecorder#invert_rename_index
* Merge branch 'master' of git://github.com/lifo/docrailsXavier Noria2011-07-051-1/+1
|\
| * fix typo in method nameVijay Dev2011-06-251-1/+1
| |
| * Revert "add missing methods supported by reversible migrations using the ↵Vijay Dev2011-06-251-4/+1
| | | | | | | | | | | | | | | | | | change method" This reverts commit 7f91eebae361f2f3a1558f6d899b372524509a2d. Reason: Incorrect documenting. The newly added methods to the list are not actually supported by reversible migrations.
| * add missing methods supported by reversible migrations using the change methodVijay Dev2011-06-241-1/+4
| |
* | Reversing the changes done in c278a2c while still resolving #1857.Vijay Dev2011-07-021-9/+5
| | | | | | | | | | | | | | | | | | 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.
* | CommandRecorder should delegate in method_missing where possible. Fixes some ↵Jon Leighton2011-06-301-1/+5
| | | | | | | | tests in migration_test.rb under mysql. The problem was introduced in c278a2c5e109204ec8a47fcbfdfc327aad7996ce.
* | record unsupported methods in CommandRecorder instead of letting the ↵Vijay Dev2011-06-251-4/+4
|/ | | | unsupported methods go through to the underlying db causing errors like duplicate columns to occur when rolling back migrations
* Merge branch 'master' of git://github.com/lifo/docrailsXavier Noria2011-06-061-6/+6
|\ | | | | | | | | Conflicts: activerecord/RUNNING_UNIT_TESTS
| * comment the recorder methodsVijay Dev2011-06-071-3/+3
| |
| * styling changesVijay Dev2011-06-021-3/+3
| |
* | Merge pull request #1229 from workmad3/masterAaron Patterson2011-05-271-2/+4
|\ \ | |/ |/| Fix for Issue #1205
| * Using .try to test for the existence of a method option in a nil-resistent ↵David Workman2011-05-231-5/+2
| | | | | | | | manner. Inlined the determination of the options hash for reversing using a ternary operator. Shortens the method in a way that keeps the code neat
| * Neatened up the invert_add_index method as per suggestonDavid Workman2011-05-231-2/+3
| |
| * Simple fix for correctly inverting an add_index migration when a name has ↵David Workman2011-05-231-2/+6
| | | | | | | | been provided
* | Remove extra white spaces on ActiveRecord docs.Sebastian Martinez2011-05-231-3/+3
|/
* Add :bulk => true option to change_tablePratik Naik2011-01-311-4/+16
|
* adding documentation for reversible migrationsAaron Patterson2010-11-191-1/+11
|
* invertable migrations are workingAaron Patterson2010-11-191-1/+1
|
* command recorder will record commands sent to a delegate objectAaron Patterson2010-11-191-3/+13
|
* updating documentationAaron Patterson2010-11-191-1/+7
|
* IrreversibleMigration is raised if we cannot invert the commandAaron Patterson2010-11-191-1/+5
|
* commands are reversedAaron Patterson2010-11-191-1/+1
|
* add and remove timestamps can be invertedAaron Patterson2010-11-191-0/+8
|