Jeremy Kemper
f7b0a857e9
Use Object#singleton_class instead of #metaclass. Prefer Ruby's choice.
2010-02-25 09:32:29 -08:00
RomD
f44a0b1d52
fix usage examples and more to use new invocations
...
Signed-off-by: Carl Lerche <carllerche@mac.com >
2010-02-06 09:51:53 -08:00
Corey Johnson
f4e5303bcf
fixed migration logger bug [ #3434 status:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-02-02 10:12:07 +01:00
Pratik Naik
dba196cb7f
Merge docrails
2010-01-17 03:26:20 +05:30
Jeffrey Hardy
652d1c19ea
Allow AR::Schema's migrations_path to be overwritten by subclasses. Defaults to 'db/migrate'
...
[#3671 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-01-08 13:08:23 -08:00
Jeremy Kemper
4300f94533
Revert "Remove connection method definition, since it's called just once."
...
Restore the connection method which was added so it can be overridden.
This reverts commit e428c75d2b .
2010-01-07 13:30:51 -08:00
Emilio Tagua
eb3ae44cca
Merge commit 'rails/master'
...
Conflicts:
activerecord/lib/active_record/migration.rb
2009-08-10 10:40:11 -03:00
Emilio Tagua
9520143159
Merge commit 'rails/master'
...
Conflicts:
activerecord/test/cases/adapter_test.rb
activerecord/test/cases/method_scoping_test.rb
2009-08-08 19:14:35 -03:00
Pratik Naik
6464d76feb
DRY migration's rollback/forward methods
2009-08-08 20:47:14 +01:00
Cristi Balan
7f84f14efa
Add rake db:forward - opposite of db:rollback [ #768 state:resolved]
...
Example:
rake db:forward # performs the next migration
rake db:forward STEP=4 # performs the next 4 migrations
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2009-08-08 17:41:43 +01:00
Emilio Tagua
3de59e916d
Merge commit 'rails/master'
...
Conflicts:
activerecord/lib/active_record/associations.rb
2009-07-31 16:21:07 -03:00
Pratik Naik
e033b5d037
Merge docrails
2009-07-25 16:03:58 +01:00
Emilio Tagua
16ac353f4c
Merge commit 'rails/master'
2009-06-16 16:59:12 -03:00
Xavier Noria
d32965399c
uses Object#metaclass and Object#class_eval in a few spots
...
[#2797 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2009-06-12 16:14:06 -07:00
Emilio Tagua
bbe51a1b9d
No need to specify the engine now that it is in active_record.rb
2009-06-02 12:27:26 -03:00
Emilio Tagua
522711952b
Refactors to work with latest Arel implementation.
2009-06-02 11:40:01 -03:00
Emilio Tagua
a04dedd563
Merge commit 'rails/master'
...
Conflicts:
activerecord/lib/active_record/base.rb
activerecord/lib/active_record/migration.rb
activerecord/test/cases/helper.rb
2009-05-18 11:18:46 -03:00
Jeremy Kemper
e8550ee032
Cherry-pick core extensions
2009-05-13 12:00:15 -07:00
Emilio Tagua
8885b2d6c1
Refactor to calculations. Migration's versions are string not integer. ARel submodule updated.
2009-05-06 14:16:03 -03:00
Emilio Tagua
e428c75d2b
Remove connection method definition, since it's called just once.
2009-04-23 18:59:35 -03:00
Emilio Tagua
7958308ef6
More progress on migrations. Arel updated.
2009-04-23 18:54:04 -03:00
Emilio Tagua
d8f99c36ba
Added Arel integration to migration's version update table
2009-04-23 13:55:42 -03:00
Jeremy Kemper
6f8ed1cd3f
Migrations: make default database connection overridable
2009-02-04 12:21:22 -08:00
Pratik Naik
dbbae5e00e
Merge with docrails
2008-12-07 03:27:53 +01:00
Tarmo Tänav
00d2165f74
Back to fetching all versions in ruby instead of letting SQL do it as it's difficult to get all databases to convert the text value to a number with the same SQL
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-08-26 03:00:36 -07:00
Tarmo Tänav
77b003fb61
Use DECIMAL instead of INTEGER when casting as mysql doesn't work with just "INTEGER" and other databases don't like "UNSIGNED" which mysql requires
...
And don't mask exceptions.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-08-25 23:23:34 -07:00
Tarmo Tänav
3d2ac918b9
Cache migrated versions list in Migrator and use it to fetch the latest migrated version name [ #845 state:resolved]
...
Also optimized Migrator#current_version class method to fetch
only the latest version number and not all of them.
With this change no matter how many migrations there are the
schema_migrations table is only SELECTed from once.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-08-25 22:03:47 -07: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
Nik Wakelin
0809747845
Added MigrationProxy to defer loading of Migration classes until they are actually required by the migrator
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#747 state:resolved]
2008-08-06 12:46:52 +02:00
Nik Wakelin
bbab639136
Set config.active_record.timestamped_migrations = false to have migrations with numeric prefix instead of UTC timestamp. [ #446 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-07-17 02:54:45 +01:00
Michael Raidel
f94600bdaf
ActiveRecord::Migrator#run records version-state after migrating. [ #369 state:resolved]
2008-06-22 18:16:17 -07:00
Pratik Naik
98dc582742
Merge docrails.
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-05-25 12:29:00 +01: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
Xavier Noria
64092de257
Improve documentation coverage and markup
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-05-02 14:45:23 +01:00
Ian White
82b4faf812
Fix migrations when migrating to a specified version number with a fresh database [ #1 state:resolved]
...
Signed-off-by: Joshua Peek <josh@joshpeek.com >
2008-04-17 13:43:47 -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
David Heinemeier Hansson
3704f4ba2e
Fix new migration versions
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9126 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-03-28 22:14:04 +00:00
David Heinemeier Hansson
c00de99f69
Switched to UTC-timebased version numbers for migrations and the schema. This will as good as eliminate the problem of multiple migrations getting the same version assigned in different branches. Also added rake db:migrate:up/down to apply individual migrations that may need to be run when you merge branches ( closes #11458 ) [jbarnette]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9122 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-03-28 21:21:01 +00:00
Pratik Naik
ca9413674e
Improve documentation.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9093 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-03-26 12:27:52 +00:00
Jeremy Kemper
8b5f4e474f
Ruby 1.9 compat: fix warnings, shadowed block vars, and unitialized instance vars
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8481 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-22 11:26:03 +00:00
Jeremy Kemper
699da7001b
The test task stops with a warning if you have pending migrations. Closes #10377 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8324 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-06 18:57:19 +00:00
Michael Koziarski
a406643b95
Improve documentation for IrreversibleMigrations. Closes #9636 [toolmantim]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8129 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-11 21:31:59 +00:00
Marcel Molina
7143d80147
Smattering of grammatical fixes to documentation. Closes #10083 [BobSilva]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8113 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-08 03:37:16 +00:00
Marcel Molina
27941f649f
Update add_index documentation to use new options api. Closes #9787 [kamal]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8031 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-26 03:55:22 +00:00
Michael Koziarski
ac3cf43182
Raise an intelligible error message when migration aren't named correctly [bronson] Closes #9909
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7957 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-17 21:35:19 +00:00
Michael Koziarski
ce47db3366
Change Migration documentation to use the new syntax. Closes #9813 [sjgman9]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7788 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-08 03:18:18 +00:00
David Heinemeier Hansson
766fbce04e
Fixed that using version-targetted migrates would fail on loggers other than the default one ( closes #7430 ) [valeksenko]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7577 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 22:18:55 +00:00
David Heinemeier Hansson
0442f1ea75
Docfix ( closes #7593 ) [tarmo]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7570 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 18:35:41 +00:00
Jeremy Kemper
319107ae40
Migrations: report the number of rows affected when calling insert, update, delete, etc.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6945 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-05 08:21:55 +00:00
Jeremy Kemper
d0d5a1fe23
Announce migration versions as they're performed.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6855 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-26 02:36:55 +00:00