aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migrator_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Internal test migrations use the private 'Current' versionMatthew Draper2015-12-151-1/+1
| | | | | | | | 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-2/+2
| | | | | | | | | | 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?`.
* Closes rails/rails#18864: Renaming transactional fixtures to transactional testsBrandon Weiss2015-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | I’m renaming all instances of `use_transcational_fixtures` to `use_transactional_tests` and “transactional fixtures” to “transactional tests”. I’m deprecating `use_transactional_fixtures=`. So anyone who is explicitly setting this will get a warning telling them to use `use_transactional_tests=` instead. I’m maintaining backwards compatibility—both forms will work. `use_transactional_tests` will check to see if `use_transactional_fixtures` is set and use that, otherwise it will use itself. But because `use_transactional_tests` is a class attribute (created with `class_attribute`) this requires a little bit of hoop jumping. The writer method that `class_attribute` generates defines a new reader method that return the value being set. Which means we can’t set the default of `true` using `use_transactional_tests=` as was done previously because that won’t take into account anyone using `use_transactional_fixtures`. Instead I defined the reader method manually and it checks `use_transactional_fixtures`. If it was set then it should be used, otherwise it should return the default, which is `true`. If someone uses `use_transactional_tests=` then it will overwrite the backwards-compatible method with whatever they set.
* tests, favor `drop_table` and `:if_exists` over raw SQL.Yves Senn2015-03-021-1/+1
| | | | | We've replaced most querues using DROP TABLE in our tests already. This patch replaces the last couple calls.
* Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-291-2/+2
|
* Merge pull request #17302 from ↵Rafael Mendonça França2014-10-181-3/+3
| | | | | | claudiob/replace-slower-block-call-with-faster-yield Replace (slower) block.call with (faster) yield
* Revert "Replace (slower) block.call with (faster) yield"Zachary Scott2014-10-181-3/+3
| | | | This reverts commit 0ab075e75f58bf403f7ebe20546c7005f35db1f6.
* Replace (slower) block.call with (faster) yieldclaudiob2014-10-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Performance optimization: `yield` with an implicit `block` is faster than `block.call`. See http://youtu.be/fGFM_UrSp70?t=10m35s and the following benchmark: ```ruby require 'benchmark/ips' def fast yield end def slow(&block) block.call end Benchmark.ips do |x| x.report('fast') { fast{} } x.report('slow') { slow{} } end # => fast 154095 i/100ms # => slow 71454 i/100ms # => # => fast 7511067.8 (±5.0%) i/s - 37445085 in 4.999660s # => slow 1227576.9 (±6.8%) i/s - 6145044 in 5.028356s ```
* Reset ActiveRecord::Migration.message_count counter before start testingAkira Matsuda2014-08-291-1/+1
|
* Bring original puts back after finishing testsAkira Matsuda2014-08-291-0/+12
|
* Reset ActiveRecord::Migration.verbose to the value beforeAkira Matsuda2014-08-291-1/+2
|
* Demodulize ActiveRecord::MigratorTestAkira Matsuda2014-08-291-284/+282
|
* No need for trailing slash on migration path.Jeremy Kemper2014-04-241-1/+1
| | | | | | | Causes a double // in Dir.glob that breaks Ruby 2.2-trunk. Not really a bug, but not relevant to this test either. Originally added in ed21f0c50270139ddb6993acfdaea4586ffd09a3
* Use teardown helper method.Guo Xiang Tan2014-03-141-2/+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.
* Revert "Used Yield instead of block.call" -- this causes all of ↵David Heinemeier Hansson2013-11-141-3/+3
| | | | | | atom_feed_helper_test.rb to fail with "SystemStackError: stack level too deep". This reverts commit d3a1ce1cdc60d593de1682c5f4e3230c8db9a0fd.
* Used Yield instead of block.callKuldeep Aggarwal2013-11-151-3/+3
|
* Remove deprecated String constructor from `ActiveRecord::Migrator`.Yves Senn2013-07-041-6/+0
|
* Reset AR::Migration.verbose change to avoid depending on test run orderAkira Matsuda2013-01-081-0/+1
|
* Alias refute methods to assert_not and perfer assert_not on testsRafael Mendonça França2012-12-311-4/+4
|
* recognize migrations, in folders containing numbers and 'rb'.Yves Senn2012-12-131-0/+6
| | | | Closes #8492
* Move to the schema-migrations-metadata branch.Jeremy Kemper2012-12-091-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Add metadata to schema_migrationsJosh Susser2012-12-011-3/+6
| | | | | migrated_at: timestamp when migration run fingerprint: md5 hash of migration source name: filename without version or extension
* stop more ddl changesAaron Patterson2012-01-161-0/+16
|
* stop ddl modifications for another testAaron Patterson2012-01-161-0/+10
|
* use one based indexes for the mock migrationsAaron Patterson2012-01-161-16/+16
|
* stop making ddl changes for migrator testsAaron Patterson2012-01-161-12/+78
|
* actually use the variable I created. :bomb: thanks @exvivaAaron Patterson2012-01-161-1/+1
|
* move another migrator to use sensorsAaron Patterson2012-01-161-0/+18
|
* moving verbosity tests to the migrator test, removing ddl changesAaron Patterson2012-01-161-0/+24
|
* silencing migrator tests, refactoring the migration test helperAaron Patterson2012-01-161-0/+1
|
* prefer method sensors over actual ddl changesAaron Patterson2012-01-161-0/+84
|
* testing the current version methodAaron Patterson2012-01-161-1/+26
|
* refactor schema migration table creation to the schema migration modelAaron Patterson2012-01-131-0/+1
|
* stop depending on the filesystem for interleaved migration testsAaron Patterson2012-01-131-1/+49
|
* move another migrator test, use schema migration modelAaron Patterson2012-01-131-0/+9
|
* move another migrator test to the correct classAaron Patterson2012-01-131-0/+11
|
* moving more migrator tests to the right test caseAaron Patterson2012-01-131-0/+38
|
* moving migrator tests to a migrator test classAaron Patterson2012-01-131-0/+26