1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

21 commits

Author SHA1 Message Date
Yves Senn
8683396dd8 Merge pull request #16827 from kuldeepaggarwal/f-disable-migration-logging
disable migrations logging while running test cases for AR schema tests
2014-09-08 11:50:15 +02:00
Kuldeep Aggarwal
5663f06656 disable migrations logging while running test cases for AR schema tests 2014-09-06 21:44:08 +05:30
Sean Griffin
ea3ba34506 Change the default null value for timestamps
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.
2014-08-12 14:40:11 -06:00
Yves Senn
8fa8b7124b ActiveRecord::SchemaMigration has no primary key.
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.
2014-06-06 15:53:33 +02:00
Yves Senn
d23cbbb3ee test refactor, don't hardcode default for table_name_prefix. 2014-06-06 15:47:57 +02:00
Yves Senn
e3cd80b4cf bin/rake db:migrate:status works with legacy migration numbers.
The migration numbers were normalized different ways. This left
the task output in an inconsistent state.

Closes #15538.
2014-06-06 12:16:48 +02:00
Guo Xiang Tan
3baace687c Use teardown helper method.
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.
2014-03-14 20:48:59 -07:00
Kyle Stevens
443f8dd5cd Call assume_migrated_upto_version on connection
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.
2013-05-11 22:39:39 -04:00
Akira Matsuda
e56c80a172 Reset SchemaMigration after updating 2013-01-22 10:26:51 +09:00
Akira Matsuda
033248b5fb Needs to reset SchemaMigration first, or the tests fail in sqlite3 2013-01-07 07:37:23 +09:00
Jeremy Kemper
cff747d304 Move to the schema-migrations-metadata branch.
Pending work on graceful app upgrades.

Revert "Merge pull request #8439 from joshsusser/fixes"

This reverts commit ce8ac39338, reversing
changes made to b0e7b6f67c.

Revert "Merge pull request #8431 from joshsusser/schemadump"

This reverts commit 036d3e1c2b, reversing
changes made to 0c692f4d12.

Revert "Merge branch 'joshsusser-master' into merge"

This reverts commit 0c692f4d12, reversing
changes made to 2e299fca71.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
	activerecord/test/cases/schema_dumper_test.rb
2012-12-09 15:57:34 -07:00
Josh Susser
f02d2185eb Add migration history to schema.rb dump 2012-12-02 21:16:32 -08:00
John Firebaugh
a57990ff51 Call methods on the correct instance in AR::Schema.define
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.
2012-05-16 15:19:59 -07:00
Aaron Patterson
61774e0d49 please use ruby -I lib:test path/to/test.rb, or export RUBY_OPT 2011-06-06 15:47:13 -07:00
Jon Leighton
253bb6b926 Refactor Active Record test connection setup. Please see the 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. 2011-06-04 23:47:03 +01:00
Neeraj Singh
b58e1c52f7 fixing typo
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-18 15:13:21 +02:00
José Valim
f3839b2b99 ActiveRecord should raise an error on invalid migration types. 2010-02-28 11:53:48 +01:00
Joshua Peek
7254d23764 Autoload ActiveRecord files 2008-11-24 11:14:24 -06:00
Rick Olson
8a5a9dcbf6 Add support for interleaving migrations by storing which migrations have run 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
2008-04-09 16:20:15 +00:00
Jeremy Kemper
39814fcce0 Merge branch 'ar-test-cleanup' of git://git.geeksomnia.com/rails
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8681 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-21 17:20:51 +00:00
Jeremy Kemper
42b39ae3f2 Move tests to cases
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8660 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:30:42 +00:00
Renamed from activerecord/test/ar_schema_test.rb (Browse further)