instance method
schema_exists?
Ruby on Rails 3.2.22.5
Since v3.2.22.5 Last seen in v3.2.22.5Signature
schema_exists?(name)
Returns true if schema exists.
Parameters
-
namereq
Source
# File activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb, line 805
def schema_exists?(name)
exec_query(<<-SQL, 'SCHEMA').rows.first[0].to_i > 0
SELECT COUNT(*)
FROM pg_namespace
WHERE nspname = '#{name}'
SQL
end
Defined in activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb line 805
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::PostgreSQLAdapter