aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/ar_schema_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Deprecate `supports_migrations?` on connection adaptersRyuta Kamizono2017-02-271-110/+107
| | | | | | | `supports_migrations?` was added at 4160b518 to determine if schema statements (`create_table`, `drop_table`, etc) are implemented in the adapter. But all tested databases has been supported migrations since a4fc93c3 at least.
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-2/+2
|
* Merge pull request #26019 from agrobbin/schema-load-unique-column-indicesRafael França2016-08-161-0/+16
|\ | | | | Support multiple indexes on the same column when loading the schema
| * support multiple indexes on the same column when loading the schemaAlex Robbin2016-08-021-0/+16
| |
* | modernizes hash syntax in activerecordXavier Noria2016-08-061-4/+4
| |
* | applies new string literal convention in activerecord/testXavier Noria2016-08-061-6/+6
|/ | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Make to primary key instead of an unique index for internal tablesRyuta Kamizono2016-01-311-1/+1
|
* Get update_attributes working with SchemaMigrationschneems2016-01-081-2/+2
| | | | You cannot use `update_attributes` on models that do not have a primary key. Since SchemaMigration versions are guaranteed to be unique (they have a unique index on them) we can safely use them as a primary key.
* 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.
* Change the default `null` value for `timestamps` to `false`Rafael Mendonça França2015-01-041-51/+20
|
* synchronize code and docs for `timestamps` and `add_timestamps`.Yves Senn2014-11-201-0/+9
| | | | | | | | This makes the following changes: * warn if `:null` is not passed to `add_timestamps` * `timestamps` method docs link to `add_timestamps` docs * explain where additional options go * adjust examples to include `null: false` (to prevent deprecation warnings)
* Merge pull request #16827 from kuldeepaggarwal/f-disable-migration-loggingYves Senn2014-09-081-1/+4
|\ | | | | | | disable migrations logging while running test cases for AR schema tests
| * disable migrations logging while running test cases for AR schema testsKuldeep Aggarwal2014-09-061-0/+2
|/
* Change the default `null` value for timestampsSean Griffin2014-08-121-0/+57
| | | | | | | 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.
* `ActiveRecord::SchemaMigration` has no primary key.Yves Senn2014-06-061-0/+14
| | | | | | | | | | Before this patch, using `ActiveRecord::Base.primary_key_prefix_type` with `:table_name_with_underscore` would change the `SchemaMigration` model to have a primary key. This resulted in broken queries for PG because it tried to return the inserted PK (which does not exist). Closes #15051. Closes #15419.
* test refactor, don't hardcode default for `table_name_prefix`.Yves Senn2014-06-061-1/+2
|
* `bin/rake db:migrate:status` works with legacy migration numbers.Yves Senn2014-06-061-0/+7
| | | | | | | The migration numbers were normalized different ways. This left the task output in an inconsistent state. Closes #15538.
* 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.
* Call assume_migrated_upto_version on connectionKyle Stevens2013-05-111-0/+20
| | | | | | | | | | | Call assume_migrated_upto_version on connection to prevent it from first being picked up in method_missing. In the base class, Migration, method_missing expects the argument to be a table name, and calls proper_table_name on the arguments before sending to connection. If table_name_prefix or table_name_suffix is used, the schema version changes to prefix_version_suffix, breaking `rake test:prepare`. Fixes #10411.
* Reset SchemaMigration after updatingAkira Matsuda2013-01-221-0/+1
|
* Needs to reset SchemaMigration first, or the tests fail in sqlite3Akira Matsuda2013-01-071-1/+1
|
* Move to the schema-migrations-metadata branch.Jeremy Kemper2012-12-091-51/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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 migration history to schema.rb dumpJosh Susser2012-12-021-0/+51
|
* Call methods on the correct instance in AR::Schema.defineJohn Firebaugh2012-05-161-0/+7
| | | | | Now that migrations support instance methods, we should use the same instance rather than relying on delegation to a global instance. This allows subclassing AR::Schema.
* 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.
* fixing typoNeeraj Singh2010-07-181-1/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* ActiveRecord should raise an error on invalid migration types.José Valim2010-02-281-0/+10
|
* Autoload ActiveRecord filesJoshua Peek2008-11-241-1/+0
|
* Add support for interleaving migrations by storing which migrations have run ↵Rick Olson2008-04-091-2/+2
| | | | | | in the new schema_migrations table. Closes #11493 [jordi] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9244 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Merge branch 'ar-test-cleanup' of git://git.geeksomnia.com/railsJeremy Kemper2008-01-211-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8681 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Move tests to casesJeremy Kemper2008-01-181-0/+33
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8660 5ecf4fe2-1ee6-0310-87b1-e25e094e27de