Commit Graph

31 Commits

Author SHA1 Message Date
Gregory N. Schmit
78955b925a
Sort migration ID as int in db:migrate:status for consistency. 2021-07-16 13:10:31 -05:00
Jacopo
db95871cf4 Show a warning when running no migration using SCOPE
When running a migration with `ENV["SCOPE"]` set returns a warning
if no migrations ran.
The message serves as a hint for the end-user to make sure he knows
that the migration have been filtered by `SCOPE`.
2021-01-26 15:05:35 +01:00
bogdanvlviv
ce03e7d991
Fix occurrences Fixnum|Bignum
Related to d4eb0dc89e (r27830891)
2018-03-04 20:44:30 +02:00
Koichi ITO
5206dd6d32 Unify the internal source control .keep file name 2017-08-24 13:40:26 +09:00
Kir Shatrov
831be98f9a Use frozen-string-literal in ActiveRecord 2017-07-19 22:27:07 +03:00
Ryuta Kamizono
0ba55d2e0c Fix test_copying_migrations_preserving_magic_comments
Since #29540, `# frozen_string_literal: true` included original
migration files.
2017-07-02 02:05:07 +09:00
Matthew Draper
87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
2017-07-02 02:15:17 +09:30
Kir Shatrov
cfade1ec7e Enforce frozen string in Rubocop 2017-07-01 02:11:03 +03:00
Xavier Noria
d22e522179 modernizes hash syntax in activerecord 2016-08-06 19:37:57 +02:00
Ryuta Kamizono
6cbd96aa14 Fix migration class names in tests 2016-05-28 14:16:43 +09:00
Matthew Draper
a6d4e5e532 Internal test migrations use the private 'Current' version
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.
2015-12-15 17:18:09 +10:30
Sean Griffin
b3fdf9c596 Add line endings to files which are missing them
These files get modified whenever someone uses a tool like `sed`. Let's
just get this over with in one commit so it'd not adding diff noise to
something else.
2015-02-17 13:28:06 -07:00
Dylan Thacker-Smith
06ace1e2b5 activerecord: Initialize Migration with version from MigrationProxy. 2014-01-06 10:46:35 -05:00
OZAWA Sakuro
c3a26c592c Preserve magic comments and content encoding of copied migrations.
During insertion of "# This migration comes from ... " comment at the beginning of
a migration, presence of magic comment was not considered.
2013-03-09 15:38:02 +09:00
Yves Senn
349d460600 recognize migrations, in folders containing numbers and 'rb'.
Closes #8492
2012-12-13 09:08:32 +01: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 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
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
Aaron Patterson
8a3dcd716c stop depending on the filesystem for interleaved migration tests 2012-01-13 14:33:59 -08:00
Aaron Patterson
dea59f0150 removing migration files as they are no longer needed 2012-01-13 14:33:57 -08:00
Aaron Patterson
a85625dacf instantiate our own broken migration rather than relying on the filesystem 2012-01-13 14:33:53 -08:00
Piotr Sarnacki
1d9de9d758 Run also migrations in subdirectories.
With this commit, ActiveRecord will also look for migrations
in db/migrate subdirectories.
2011-12-09 03:33:06 +01:00
Piotr Sarnacki
62d556424a Ignore origin comment when checking for duplicates on Migration.copy
49ebe51 fixed copying migrations, but existing migrations would still
trigger warnings. The proper way to compare migrations is to ignore
origin lines - if migration is identical it means that we can
silently skip it, regardless where it comes from.
2011-12-09 01:54:20 +01:00
Vasiliy Ermolovich
0968ee3456 add prefix and suffix to renamed tables, closes #1510 2011-12-06 10:02:45 -08:00
Aaron Patterson
47737681fd in the middle of refactoring 2010-12-03 12:00:09 -08:00
Piotr Sarnacki
4377f8eba2 Change the method for copying migrations, do not add scope.
The purpose of this change is to allow copying fail on the same names.
Migrations change database and they should be treated with caution,
if 2 migrations are named the same it's much better to skip migration
and allow user decide if it should be copied or not.
2010-10-09 21:32:34 +02:00
Piotr Sarnacki
e063879daf Fix copying migrations to empty directory 2010-09-03 22:59:10 +02:00
Piotr Sarnacki
75f8ac6ea7 Implemented ActiveRecord::Migrations#copy based on James Adam's idea
ActiveRecord::Migration#copy allows to copy migrations from one place
to another, changing migrations versions and adding scope to filename.

For example:
ActiveRecord::Migration.copy("db/migrate",
        :blog_engine => "vendor/gems/blog/db/migrate")

will copy all migrations from vendor/gems/blog/db/migrate to db/migrate
with such format:

Versions of copied migrations will be reversioned to be appended after
migrations that already exists in db/migrate
2010-09-03 22:59:09 +02:00
Tarmo Tänav
707ee0e269 Made migrations transactional for PostgreSQL [#834 state:resolved]
Patch originally from http://dev.rubyonrails.org/ticket/5470
2008-08-22 14:46:25 -07:00
Aslak Hellesøy
10fdf44236 Added protection against duplicate migration names (Aslak Hellesøy) [#112 state:resolved] 2008-05-11 13:37:29 -05: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
e899a83a85 move migrations
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8658 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:28:07 +00:00