aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration/compatibility_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* make change_column_comment and change_table_comment invertibleYoshiyuki Kinjo2019-04-151-0/+29
| | | | | | | | | We can revert migrations using `change_column_comment` or `change_table_comment` at current master. However, results are not what we expect: comments are remained in new status. This change tells previous comment to these methods in a way like `change_column_default`.
* Fix `presicion` -> `precision`yuuji.yaginuma2019-04-131-2/+2
| | | | This fix is necessary to test precision's default correctly.
* Make `t.timestamps` with precision by defaultRyuta Kamizono2019-01-261-0/+71
|
* Fix `t.timestamps` missing `null: false` in `change_table bulk: true`Ryuta Kamizono2019-01-261-0/+17
|
* Allow `column_exists?` giving options without typeRyuta Kamizono2019-01-261-6/+6
|
* Fix `transaction` reverting for migrationsfatkodima2018-09-261-0/+14
| | | | [fatkodima & David Verhasselt]
* Use assert_predicate and assert_not_predicateDaniel Colson2018-01-251-4/+4
|
* SQLite: Add more test cases for adding primary keyRyuta Kamizono2017-12-261-58/+48
|
* Fix `add_column` with :primary_key type compatibility for SQLitefatkodima2017-12-251-0/+19
|
* `change_column_default` should be executed after type changingRyuta Kamizono2017-12-031-2/+2
| | | | | | | | | | | | | | | | | | | | If do not execute a type changing first, filling in default value may be failed. ``` % ARCONN=postgresql be ruby -w -Itest test/cases/migration/compatibility_test.rb -n test_legacy_change_column_with_null_executes_update Using postgresql Run options: -n test_legacy_change_column_with_null_executes_update --seed 20459 E Error: ActiveRecord::Migration::CompatibilityTest#test_legacy_change_column_with_null_executes_update: StandardError: An error has occurred, this and all later migrations canceled: PG::StringDataRightTruncation: ERROR: value too long for type character varying(5) : UPDATE "testings" SET "foo"='foobar' WHERE "foo" IS NULL ```
* Fix `test_add_column_with_timestamp_type` failureRyuta Kamizono2017-12-031-0/+2
| | | | | | | This test failed due to dirty schema cache. It is needed to call `clear_cache!` when using same named table with different definition. https://travis-ci.org/rails/rails/jobs/310627767#L769-L772
* Fix warning: assigned but unused variable - tRyuta Kamizono2017-12-031-1/+1
|
* Extract sql fragment generators for alter table from PostgreSQL adapterDinah Shi2017-12-021-0/+17
|
* Should test `LegacyPrimaryKeyTest` to both `V5_0` and `V4_2`Ryuta Kamizono2017-10-181-15/+34
|
* compatibility - use int instead of bigintpavel2017-10-181-0/+3
|
* Adding legacy primary key should be compatibleRyuta Kamizono2017-09-231-0/+51
| | | | | | | Currently implicit legacy primary key is compatible, but adding explicit legacy primary key is not compatible. It should also be fixed. Fixes #30664.
* make create_join_table compatible.Yuki Masutomi2017-09-201-0/+30
|
* Use frozen-string-literal in ActiveRecordKir Shatrov2017-07-191-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Add test for backward compatibility when using change_tableKoichi ITO2017-06-131-0/+15
|
* `primary_key` and `references` columns should be identical typeRyuta Kamizono2017-02-071-0/+4
| | | | | | | | Follow up to #26266. The default type of `primary_key` and `references` were changed to `bigint` since #26266. But legacy migration and sqlite3 adapter should keep its previous behavior.
* Restore the behaviour of the compatibility layer for integer-like PKsRyuta Kamizono2017-02-041-0/+104
| | | | | | | | | | | | | | | | | | | | | The PR #27384 changed migration compatibility behaviour. ```ruby class CreateMasterData < ActiveRecord::Migration[5.0] def change create_table :master_data, id: :integer do |t| t.string :name end end end ``` Previously this migration created non-autoincremental primary key expected. But after the PR, the primary key changed to autoincremental, it is unexpected. This change restores the behaviour of the compatibility layer.
* show correct class name in migration inherited directly erroryuuji.yaginuma2017-01-241-2/+3
| | | | Follow up to 249f71a
* Raises when `ActiveRecord::Migration` is inherited directly.Rafael Mendonça França2016-12-291-12/+6
|
* modernizes hash syntax in activerecordXavier Noria2016-08-061-3/+3
|
* applies new string literal convention in activerecord/testXavier Noria2016-08-061-5/+5
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Fix random failures of tests on TravisPrathamesh Sonpatki2016-02-121-1/+1
| | | | | | | | | | - Tests on Travis are randomly failing because schema_migrations table does not exist in teardown block. - Also checked that all other places where we have used `ActiveRecord::SchemaMigration.delete_all` we have rescued it, so used it here also. This failure was not specifically related to the test added in this PR but to overall compatibility migration tests, so adding as separate commit.
* Correctly show deprecation warning for incompatible migrationsPrathamesh Sonpatki2016-02-121-0/+12
|
* Added test for backward compatibility of null constraints on timestamp columnsPrathamesh Sonpatki2016-01-311-0/+30
|
* Pare back default `index` option for the migration generatorPrathamesh Sonpatki2016-01-241-0/+18
| | | | | | | | | | - Using `references` or `belongs_to` in migrations will always add index for the referenced column by default, without adding `index:true` option to generated migration file. - Users can opt out of this by passing `index: false`. - Legacy migrations won't be affected by this change. They will continue to run as they were before. - Fixes #18146
* fix remove_index for postgresql when running legacy migrationsLachlan Sylvester2016-01-061-0/+16
|
* Support removing custom-names indexes when only specifying column namesGrey Baker2015-12-151-0/+42