Module: ActiveRecord::Collation::SchemaStatements

Defined in:
lib/active_record/collation/schema_statements.rb

Overview

Defines methods to create, drop, and inspect collations on a schema in Postgres.

Instance Method Summary collapse

Instance Method Details

#collationsObject



20
21
22
# File 'lib/active_record/collation/schema_statements.rb', line 20

def collations
  internal_exec_query(collations_sql, 'SCHEMA')
end

#create_collation(name, icu_locale) ⇒ Object



7
8
9
10
11
12
# File 'lib/active_record/collation/schema_statements.rb', line 7

def create_collation(name, icu_locale)
  execute(
    'CREATE COLLATION IF NOT EXISTS ' \
    "#{name} (provider = icu, locale = #{quote(icu_locale)})"
  )
end

#drop_collation(name) ⇒ Object



14
15
16
17
18
# File 'lib/active_record/collation/schema_statements.rb', line 14

def drop_collation(name)
  execute(
    "DROP COLLATION IF EXISTS #{name}"
  )
end