aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* MySQL: skip GTID-unsafe statement tests when enforce_gtid_consistency is enabledJeremy Kemper2014-09-011-17/+19
|
* MigrationTest doesn't need to be verbose anymoreAkira Matsuda2014-08-291-1/+1
|
* No tests are dealing with ActiveRecord::Migration.message_count here anymoreAkira Matsuda2014-08-291-1/+0
|
* Reset ActiveRecord::Migration.verbose to the value beforeAkira Matsuda2014-08-291-1/+3
|
* Drop schema_migrations table only when existsAkira Matsuda2014-08-201-1/+1
|
* Merge pull request #16349 from jmcnevin/masterRafael Mendonça França2014-08-191-0/+15
|\ | | | | Correctly determine if migration is needed.
| * Correctly determine if migration is needed.Jeremy McNevin2014-08-131-0/+15
| | | | | | | | | | | | | | This method would assume that if last migration in the migrations directory matched the current schema version, that the database was up to date, but this does not account for new migrations with older timestamps that may be pending.
* | Change the default `null` value for timestampsSean Griffin2014-08-121-1/+1
|/ | | | | | | As per discussion, this changes the model generators to specify `null: false` for timestamp columns. A warning is now emitted if `timestamps` is called without a `null` option specified, so we can safely change the behavior when no option is specified in Rails 5.
* build fix, remove not null constraint.Yves Senn2014-07-221-1/+1
| | | | | | | | | | | The fixtures are still in play, adding a new column without a default and `null: true` is not possible. This reverts back to leaking global state, as our `schema.rb` adds the `null: false` constraint on this field. A future solution would be to make the `migration_test.rb` run independent of fixture tables. This way we can simply drop the state after test execution, without worrying about side effects. /cc @zuhao
* Remove length limit that results failure in other tests.Zuhao Wan2014-07-221-1/+1
|
* Keep quietly and capture undeprecated on your suiteRafael Mendonça França2014-07-151-0/+10
|
* Don't type cast the default on the columnSean Griffin2014-06-171-1/+1
| | | | | | | If we want to have type decorators mess with the attribute, but not the column, we need to stop type casting on the column. Where possible, we changed the tests to test the value of `column_defaults`, which is public API. `Column#default` is not.
* Rename `property` to `attribute`Sean Griffin2014-06-071-3/+3
| | | | For consistency with https://github.com/rails/rails/pull/15557
* Remove deprecated method ActiveRecord::Migrator.proper_table_nameAkshay Vishnoi2014-06-051-41/+0
|
* Silence deprecation warning in testSean Griffin2014-05-271-0/+3
| | | | Missed a case that only occured for mysql/mysql2
* Deprecate decimal columns being automatically treated as integersSean Griffin2014-05-271-1/+4
| | | | | | With ActiveRecord::Properties, we now have a reasonable path for users to continue to keep this behavior if they want it. This is an edge case that has added a lot of complexity to the code base.
* Use teardown helper method.Guo Xiang Tan2014-03-141-2/+2
| | | | | | | | 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.
* we have `with_env_tz` as global test helper. Remove duplicate.Yves Senn2014-01-161-7/+0
|
* isolate class attribute assignment in `migration_test.rb`Yves Senn2014-01-161-22/+33
| | | | | | | | This makes the tests inside `migration_test.rb` order independent. The assignments to `Reminder.table_name_prefix` and `Reminder.table_name_suffix` previously leaked and had impact on following test cases. This patch isolates the assignments on a throw-away subclass.
* activerecord: Initialize Migration with version from MigrationProxy.Dylan Thacker-Smith2014-01-061-0/+4
|
* support creating temporary tables from queriesCody Cutrer2013-12-141-0/+26
| | | | | also override drop_table in AbstractMySQLAdapter to properly drop temporary tables without committing the transaction
* Get rid of hack for freezing time on AR testsCarlos Antonio da Silva2013-12-121-5/+5
| | | | | We can now make use of the existent #travel/#travel_to helper methods added to AS test case and available in all tests.
* test should clean up after themselvesAaron Patterson2013-11-151-0/+3
|
* Remove more skipRafael Mendonça França2013-11-081-2/+0
|
* Don't skip tests if we don't need to.Rafael Mendonça França2013-11-081-100/+92
| | | | | | | We can conditional define the tests depending on the adapter or connection. Lets keep the skip for fail tests that need to be fixed.
* Warnings removed for ruby trunkArun Agrawal2013-11-011-19/+19
| | | Same as 4d4ff531b8807ee88a3fc46875c7e76f613956fb
* added schema_migrations_table_name to ActiveRecord::Base in order that the ↵Jerad Phelps2013-10-271-1/+10
| | | | | | | | | | | | | | | | | | | | name of the schema migrations table can be configured. consolidated test_schema_migrations_table_name tests Added changelog entry edited changelog removed commented lines removed reader ensure the schema migrations table is reset at end of test added entry to configuration guide guides typo and changelog order
* Adding deprecation assertions for proper_table_name.wangjohn2013-08-241-7/+21
| | | | This prevents deprecation warnings from popping up.
* Making proper_table_name take in options.wangjohn2013-08-221-1/+28
| | | | | | | | | | | The options will specify the prefix and the suffix. Also, I'm moving the method to be an instance method on the +Migration+ instance. This makes more sense than being a class method on the +Migrator+ class because the only place that uses it is on a +Migration+ instance (in a method_missing hook). The logic for the Migrator shouldn't be doing any work to calculate the table name, it should be the Migration itself. Also made some small indentation fixes.
* Revert "fix order dependent test related to migration"Akira Matsuda2013-07-291-4/+0
| | | | | | This reverts commit 10259c3e906da2191ef0d43cd664a3b5504d9f8c. reason: this causes rake test_mysql and test_mysql2 fail
* fix order dependent test related to migrationNeeraj Singh2013-07-281-0/+4
| | | | | | If the order in which tests are executed is changed then test fails. This commit ensures that all migrations are run before ensuring that there are no pending migration.
* removes the obsolete private method column_methods_hash [Closes #11406]Xavier Noria2013-07-161-15/+10
|
* Fix #10789. Now at last ::Logger doesn't support #silence method .kennyj2013-06-051-0/+9
|
* Improve the error messageRafael Mendonça França2013-04-191-1/+1
|
* Support transactions in Migrator.runbondarev2013-04-181-0/+26
|
* Preserve magic comments and content encoding of copied migrations.OZAWA Sakuro2013-03-091-0/+20
| | | | | During insertion of "# This migration comes from ... " comment at the beginning of a migration, presence of magic comment was not considered.
* If an index can't be found by column, use the index name.Ezekiel Smithburg2013-03-071-0/+16
| | | | schema_statements uses the column name by default to construct the index name, and then raises an exception if it doesn't exist, even if the name option is specified, which causes #8858. this commit makes index_name_for_remove fall back to constructing the index name to remove based on the name option.
* transactions can be turned off per Migration.Yves Senn2013-03-051-0/+32
| | | | | | | | | | | Closes #9483. There are SQL Queries that can't run inside a transaction. Since the Migrator used to wrap all Migrations inside a transaction there was no way to run these queries within a migration. This patch adds `self.disable_ddl_transaction!` to the migration to turn transactions off when necessary.
* transactional migration test-case was broken.Yves Senn2013-03-051-3/+7
| | | | | | The cleanup commit a85625d broke the test-case. The schema was no longer modified so there was no way to check that the rollback actually happened.
* Be sure to clear schema cacheAkira Matsuda2013-01-221-0/+3
|
* Reset table_name_{prefix,suffix}, and table_name after each testAkira Matsuda2013-01-221-11/+4
| | | | because some tests were not resetting them, and thus the tests were order dependent
* Fix failing test under sqlite3Akira Matsuda2013-01-071-1/+1
|
* Alias refute methods to assert_not and perfer assert_not on testsRafael Mendonça França2012-12-311-2/+2
|
* Move to the schema-migrations-metadata branch.Jeremy Kemper2012-12-091-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | Pending work on graceful app upgrades. Revert "Merge pull request #8439 from joshsusser/fixes" This reverts commit ce8ac39338f86388e70356b3a470b3ea443802ae, reversing changes made to b0e7b6f67c984d4b1502e801781ed75fad681633. Revert "Merge pull request #8431 from joshsusser/schemadump" This reverts commit 036d3e1c2b65c4b8cbd23de2e20ad67b9b756182, reversing changes made to 0c692f4d121792117b6a71e5ed590a31c3b9d12e. Revert "Merge branch 'joshsusser-master' into merge" This reverts commit 0c692f4d121792117b6a71e5ed590a31c3b9d12e, reversing changes made to 2e299fca715b083a60222a85e48f9d3b8dd8ce93. Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb activerecord/test/cases/schema_dumper_test.rb
* convert time to stringJosh Susser2012-12-061-1/+1
| | | why is this a Time to start with?
* style cleanupJosh Susser2012-12-031-1/+1
|
* Add metadata to schema_migrationsJosh Susser2012-12-011-0/+9
| | | | | migrated_at: timestamp when migration run fingerprint: md5 hash of migration source name: filename without version or extension
* Move migration test together with other join table testsCarlos Antonio da Silva2012-11-211-7/+0
|
* Merge pull request #7716 from steveklabnik/issue_7715Rafael Mendonça França2012-11-211-0/+7
|\ | | | | Coerce strings in create_join_table.
| * Coerce strings in create_join_table.Steve Klabnik2012-11-211-0/+7
| | | | | | | | | | | | | | If you accidentally pass a string and a symbol, this breaks. So we coerce them both to strings. Fixes #7715