Permalink
Browse files

Use table_exists? in #initialize_schema_migrations_table [#1923 state…

…:resolved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
  • Loading branch information...
metaskills authored and lifo committed Feb 9, 2009
1 parent 664ae18 commit b193f233908823cccd2f1d5fcb4146787ed8c4ed
@@ -316,7 +316,7 @@ def dump_schema_information #:nodoc:
def initialize_schema_migrations_table
sm_table = ActiveRecord::Migrator.schema_migrations_table_name
- unless tables.detect { |t| t == sm_table }
+ unless table_exists?(sm_table)
create_table(sm_table, :id => false) do |schema_migrations_table|
schema_migrations_table.column :version, :string, :null => false
end
@@ -327,7 +327,7 @@ def initialize_schema_migrations_table
# migrated up to that point:
si_table = Base.table_name_prefix + 'schema_info' + Base.table_name_suffix
- if tables.detect { |t| t == si_table }
+ if table_exists?(si_table)
old_version = select_value("SELECT version FROM #{quote_table_name(si_table)}").to_i
assume_migrated_upto_version(old_version)

0 comments on commit b193f23

Please sign in to comment.