Skip to content

Commit

Permalink
Remove duplicated table_exists?
Browse files Browse the repository at this point in the history
  • Loading branch information
kamipo committed Jun 13, 2019
1 parent 75eb3d0 commit c5ecc33
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
4 changes: 0 additions & 4 deletions activerecord/lib/active_record/internal_metadata.rb
Expand Up @@ -28,10 +28,6 @@ def [](key)
where(key: key).pluck(:value).first
end

def table_exists?
connection.table_exists?(table_name)
end

# Creates an internal metadata table with columns +key+ and +value+
def create_table
unless table_exists?
Expand Down
4 changes: 0 additions & 4 deletions activerecord/lib/active_record/schema_migration.rb
Expand Up @@ -22,10 +22,6 @@ def table_name
"#{table_name_prefix}#{schema_migrations_table_name}#{table_name_suffix}"
end

def table_exists?
connection.table_exists?(table_name)
end

def create_table
unless table_exists?

This comment has been minimized.

Copy link
@rpbaltazar

rpbaltazar Feb 17, 2020

@kamipo where is this method being defined then? Does somehow SchemaMigration pick it up from model_schema? Or is this method not expected to be called ?

This comment has been minimized.

Copy link
@jean-francois-labbe

jean-francois-labbe Feb 17, 2020

Contributor

It is defined in model_schema.rb but it uses connection.schema_cache.data_source_exists?(table_name), the schema_cache causes trouble when switching between Postgresql schemas.

version_options = connection.internal_string_options_for_primary_key
Expand Down

0 comments on commit c5ecc33

Please sign in to comment.