Class: ActiveRecord::ConnectionAdapters::CipherStashPG::TableDefinition
- Inherits:
-
TableDefinition
- Object
- TableDefinition
- ActiveRecord::ConnectionAdapters::CipherStashPG::TableDefinition
- Includes:
- ColumnMethods
- Defined in:
- lib/active_record/connection_adapters/7.1/cipherstash_pg/schema_definitions.rb,
lib/active_record/connection_adapters/6.1/cipherstash_pg/schema_definitions.rb,
lib/active_record/connection_adapters/7.0/cipherstash_pg/schema_definitions.rb
Overview
Active Record PostgreSQL Adapter Table Definition
Instance Attribute Summary collapse
-
#exclusion_constraints ⇒ Object
readonly
Returns the value of attribute exclusion_constraints.
-
#unique_keys ⇒ Object
readonly
Returns the value of attribute unique_keys.
-
#unlogged ⇒ Object
readonly
Returns the value of attribute unlogged.
Instance Method Summary collapse
- #exclusion_constraint(expression, **options) ⇒ Object
-
#initialize ⇒ TableDefinition
constructor
A new instance of TableDefinition.
-
#new_column_definition(name, type, **options) ⇒ Object
:nodoc:.
-
#new_exclusion_constraint_definition(expression, options) ⇒ Object
:nodoc:.
-
#new_unique_key_definition(column_name, options) ⇒ Object
:nodoc:.
- #unique_key(column_name, **options) ⇒ Object
Methods included from ColumnMethods
Constructor Details
#initialize ⇒ TableDefinition
Returns a new instance of TableDefinition.
189 190 191 192 |
# File 'lib/active_record/connection_adapters/6.1/cipherstash_pg/schema_definitions.rb', line 189 def initialize(*, **) super @unlogged = ActiveRecord::ConnectionAdapters::CipherStashPGAdapter.create_unlogged_tables end |
Instance Attribute Details
#exclusion_constraints ⇒ Object (readonly)
Returns the value of attribute exclusion_constraints.
242 243 244 |
# File 'lib/active_record/connection_adapters/7.1/cipherstash_pg/schema_definitions.rb', line 242 def exclusion_constraints @exclusion_constraints end |
#unique_keys ⇒ Object (readonly)
Returns the value of attribute unique_keys.
242 243 244 |
# File 'lib/active_record/connection_adapters/7.1/cipherstash_pg/schema_definitions.rb', line 242 def unique_keys @unique_keys end |
#unlogged ⇒ Object (readonly)
Returns the value of attribute unlogged.
187 188 189 |
# File 'lib/active_record/connection_adapters/6.1/cipherstash_pg/schema_definitions.rb', line 187 def unlogged @unlogged end |
Instance Method Details
#exclusion_constraint(expression, **options) ⇒ Object
251 252 253 |
# File 'lib/active_record/connection_adapters/7.1/cipherstash_pg/schema_definitions.rb', line 251 def exclusion_constraint(expression, **) exclusion_constraints << new_exclusion_constraint_definition(expression, ) end |
#new_column_definition(name, type, **options) ⇒ Object
:nodoc:
202 203 204 205 206 207 208 209 |
# File 'lib/active_record/connection_adapters/7.0/cipherstash_pg/schema_definitions.rb', line 202 def new_column_definition(name, type, **) # :nodoc: case type when :virtual type = [:type] end super end |
#new_exclusion_constraint_definition(expression, options) ⇒ Object
:nodoc:
259 260 261 262 |
# File 'lib/active_record/connection_adapters/7.1/cipherstash_pg/schema_definitions.rb', line 259 def new_exclusion_constraint_definition(expression, ) # :nodoc: = @conn.(name, expression, ) ExclusionConstraintDefinition.new(name, expression, ) end |
#new_unique_key_definition(column_name, options) ⇒ Object
:nodoc:
264 265 266 267 |
# File 'lib/active_record/connection_adapters/7.1/cipherstash_pg/schema_definitions.rb', line 264 def new_unique_key_definition(column_name, ) # :nodoc: = @conn.(name, column_name, ) UniqueKeyDefinition.new(name, column_name, ) end |
#unique_key(column_name, **options) ⇒ Object
255 256 257 |
# File 'lib/active_record/connection_adapters/7.1/cipherstash_pg/schema_definitions.rb', line 255 def unique_key(column_name, **) unique_keys << new_unique_key_definition(column_name, ) end |