Commit Graph

97 Commits

Author SHA1 Message Date
Piotr Sarnacki
6f8958277b Fix test on finding migrations from 2 paths
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-12-09 18:50:44 +01:00
Piotr Sarnacki
d0467e08e5 Allow to run migrations from more than one directory 2010-12-09 00:04:36 +01:00
Aaron Patterson
399730bdd2 removing unused setup 2010-12-03 12:00:09 -08:00
Aaron Patterson
47737681fd in the middle of refactoring 2010-12-03 12:00:09 -08:00
Aaron Patterson
3ec212e3c9 rolling out migrated_at until I can fix the build 2010-12-01 17:08:01 -08:00
Aaron Patterson
c15c14563e removing duplicate test 2010-12-01 15:14:56 -08:00
Aaron Patterson
4232454289 make sure we have a value in migrated_at 2010-12-01 15:07:44 -08:00
Aaron Patterson
7d2179608c not all databases return dates as strings 2010-12-01 14:59:17 -08:00
Josh Susser
7139aa878c name in schema_migrations, migrations in schema dump 2010-12-01 10:57:38 -08:00
Josh Susser
4e4e9ad48a record migration timestamp when migrations run 2010-12-01 10:46:29 -08:00
Josh Susser
c283cdd63c Add migrated_at column to schema_migrations table. 2010-12-01 10:46:29 -08:00
Aaron Patterson
68b66ef308 testing instance based migrations 2010-11-17 14:26:35 -08:00
Aaron Patterson
0bea9fd6be schema migrations work as instances 2010-11-17 14:26:34 -08:00
Aaron Patterson
8b2f801ed8 converted migrations to support instance methods 2010-11-17 14:26:34 -08:00
Aaron Patterson
77440ec51a fixing assertions so error messages will be more helpful 2010-11-17 13:02:03 -08:00
Aaron Patterson
2738ec891b removing many unused variables 2010-11-16 17:06:50 -08:00
Piotr Sarnacki
437ceab139 Create directory before copying migrations if it does not exist 2010-11-16 17:00:01 +01:00
Anil Wadghule
d7799fadf9 Fix SQLite adapter name [#5842 state:resolved] 2010-10-19 10:44:59 -07:00
Piotr Sarnacki
022205be1d Add callback on skipped migration while copying migrations 2010-10-09 21:32:34 +02: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
Aaron Patterson
5793d5e002 eliminating method_missing on TableDefinition 2010-09-29 11:18:43 -07:00
Étienne Barrié
8b8730e139 Test add_index and remove_index with a symbol name #4891 2010-09-28 10:06:57 -07:00
Tim Connor
d6f7b7d353 Fix remove_index issue when provided :name is a symbol
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-26 20:40:14 -03:00
Tim Connor
37de59eacf Fix issue with remove_index and add unit test [#5645 state:resolved] 2010-09-18 20:49:31 +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
Brian Lopez
82e389ed30 reload bob after his journy to a new timezone 2010-08-20 20:00:03 -07:00
Santiago Pastorino
bcd62cdafd Makes topics.written_on null => true back again some tests rely on that 2010-08-15 07:19:06 -03:00
Santiago Pastorino
b451de0d6d Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;) 2010-08-14 04:12:33 -03:00
Brian Lopez
21e81da335 update tests for mysql2 support 2010-08-02 01:37:57 -07:00
Thiago Pradi
8b2330ebc3 Tests to specify the behaviour of ActiveRecord::Migrator.get_all_versions() [#5066 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-08 22:29:08 +02:00
J. Pablo Fernández
21957b72ea Test that adding an index also doesn't raise an exception.
[#4809 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-29 21:17:12 +02:00
Paul Barry
0baf83fa18 Replaced statement in comment with an assertion
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-29 21:17:08 +02:00
J. Pablo Fernández
ff22b9d451 Fixed error when removing an index from a table name values, which is a reserved word, with test.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-29 21:17:07 +02:00
Andrew White
11ff3da5f4 Add column and index query methods to ActiveRecord::Schema
[#4219 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-26 01:08:32 +02:00
Jeff Dean
e639536ea8 remove_column should raise an ArgumentError when no columns are passed [#4803 state:resolved]
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2010-06-23 16:21:29 +12:00
Aaron Patterson
8e56085817 use assert_in_delta() for floating point comparisons in tests [#4871 state:resolved]
Signed-off-by: Carl Lerche <carllerche@mac.com>
2010-06-16 10:09:59 -07:00
Santiago Pastorino
cfacae1a7d SQLite2Adapter doesn't exist
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-09 10:06:24 +02:00
Raimonds Simanovskis
464b7f3ddc test fixes for Oracle enhanced adapter:
latest oracle_enhanced adapter does automatic shortening of index names
ignore select from all_triggers table in assert_queries
2010-06-04 22:44:03 +03:00
Raimonds Simanovskis
f12f377680 Oracle enhanced adapter now supports shortening of default generated index names, some additional tests now pass 2010-06-04 22:44:02 +03:00
Raimonds Simanovskis
6356a48faa Reduced size of table name prefix and suffix in migrations test as in Oracle identifier name cannot be larger than 30 characters 2010-06-04 22:44:02 +03:00
Neeraj Singh
39a246f545 Final iteration of use better testing methods
[#4652 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-19 21:31:51 +02:00
Jeremy Kemper
223d6415d0 Revert "Don't carry default value when changing column for a binary type on MySQL"
Broke mysql tests.

This reverts commit edec1afe25014749f0e2df86d27477b45586a9e3.

Conflicts:

	activerecord/test/cases/migration_test.rb

[#3234 state:open]
2010-05-18 11:02:39 -07:00
Étienne Barrié
3809c80cd5 make add_index and remove_index more resilient; new rename_index method; track database limits
[#3452 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-05-18 10:55:41 -07:00
Wijnand Wiersma
d7a3e65c50 Postgresql doesn't allow to change a string type column to a binary type. Skip this test for postgresql for now. [#4616 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-16 15:15:43 +02:00
Elomar França
edec1afe25 Don't carry default value when changing column for a binary type on MySQL [#3234 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-16 10:45:26 +02:00
Pratik Naik
8d2f6c16e3 Revert "Revert "Add index length support for MySQL [#1852 state:open]""
This reverts commit 6626833db13a69786f9f6cd56b9f53c4017c3e39.
2010-05-09 12:42:48 +01:00
José Valim
6626833db1 Revert "Add index length support for MySQL [#1852 state:open]"
This commit breaks dumping a few tables, as the sessions table.
To reproduce, just create a new application and:

  rake db:sessions:create
  rake db:migrate
  rake db:test:prepare

And then look at the db/schema.rb file (ht: Sam Ruby).

This reverts commit 5b95730edc33ee97f53da26a3868eb983305a771.
2010-05-08 17:46:39 +03:00
Emili Parreno
5b95730edc Add index length support for MySQL [#1852 state:resolved]
Example:

  add_index(:accounts, :name, :name => 'by_name', :length => 10)
  => CREATE INDEX by_name ON accounts(name(10))

  add_index(:accounts, [:name, :surname], :name => 'by_name_surname', :length => {:name => 10, :surname => 15})
  => CREATE INDEX by_name_surname ON accounts(name(10), surname(15))

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2010-05-08 12:39:46 +01:00
Neeraj Singh
f4d174b211 making rake:migrate VERSION=0 a noop called in succession. [#2137 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-29 13:41:35 +02:00