Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fixes issues in test_mysql2 #8439

Merged
merged 2 commits into from

3 participants

@joshsusser

Looks like Oracle can't check existence of index on table that doesn't exist.
Also, oddly, sometimes connection.select_all returns a Time instead of a String.

@carlosantoniodasilva carlosantoniodasilva merged commit ce8ac39 into from
@carlosantoniodasilva

@joshsusser thanks, lets see travis now :)

@yahonda

Thanks!

@jeremy jeremy referenced this pull request from a commit
@jeremy jeremy Move to the schema-migrations-metadata branch.
Pending work on graceful app upgrades.

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

This reverts commit ce8ac39, reversing
changes made to b0e7b6f.

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

This reverts commit 036d3e1, reversing
changes made to 0c692f4.

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

This reverts commit 0c692f4, reversing
changes made to 2e299fc.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
	activerecord/test/cases/schema_dumper_test.rb
cff747d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 6, 2012
  1. @joshsusser

    convert time to string

    joshsusser authored
    why is this a Time to start with?
  2. @joshsusser
This page is out of date. Refresh to see the latest.
View
6 activerecord/lib/active_record/schema_migration.rb
@@ -42,10 +42,10 @@ def self.create_table
end
def self.drop_table
- if connection.index_exists?(table_name, "version", :unique => true, :name => index_name)
- connection.remove_index(table_name, :name => index_name)
- end
if connection.table_exists?(table_name)
+ if connection.index_exists?(table_name, "version", :unique => true, :name => index_name)
+ connection.remove_index(table_name, :name => index_name)
+ end
connection.drop_table(table_name)
end
end
View
2  activerecord/test/cases/migration_test.rb
@@ -71,7 +71,7 @@ def test_migrator_versions
assert_equal m0_fingerprint, rows[0]["fingerprint"]
assert_equal "valid_people_have_last_names", rows[0]["name"]
rows.each do |row|
- assert_match(/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/, row["migrated_at"], "missing migrated_at")
+ assert_match(/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/, row["migrated_at"].to_s, "missing migrated_at") # sometimes a String, sometimes a Time
end
ActiveRecord::Migrator.down(MIGRATIONS_ROOT + "/valid")
View
2  activerecord/test/cases/schema_migration_test.rb
@@ -40,7 +40,7 @@ def test_add_metadata_columns_to_exisiting_schema_migrations
rows = connection.select_all("SELECT * FROM #{connection.quote_table_name(sm_table_name)}")
assert rows[0].has_key?("migrated_at"), "missing column `migrated_at`"
- assert_match(/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/, rows[0]["migrated_at"])
+ assert_match(/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/, rows[0]["migrated_at"].to_s) # sometimes a String, sometimes a Time
assert rows[0].has_key?("fingerprint"), "missing column `fingerprint`"
assert rows[0].has_key?("name"), "missing column `name`"
end
Something went wrong with that request. Please try again.