Module: Torque::PostgreSQL::Adapter::ColumnMethods
- Included in:
- TableDefinition
- Defined in:
- lib/torque/postgresql/adapter/schema_definitions.rb
Instance Method Summary collapse
-
#enum(*args, **options) ⇒ Object
Creates a column with an enum type, needing to specify the subtype, which is basically the name of the type defined prior creating the column.
-
#enum_set(*args, **options) ⇒ Object
Creates a column with an enum array type, needing to specify the subtype, which is basically the name of the type defined prior creating the column.
-
#interval(*args, **options) ⇒ Object
Creates a column with an interval type, allowing span of times and dates to be stored without having to store a seconds-based integer or any sort of other approach.
Instance Method Details
#enum(*args, **options) ⇒ Object
Creates a column with an enum type, needing to specify the subtype, which is basically the name of the type defined prior creating the column
18 19 20 21 |
# File 'lib/torque/postgresql/adapter/schema_definitions.rb', line 18 def enum(*args, **) subtype = .delete(:subtype) args.each { |name| column(name, (subtype || name), **) } end |
#enum_set(*args, **options) ⇒ Object
Creates a column with an enum array type, needing to specify the subtype, which is basically the name of the type defined prior creating the column
26 27 28 |
# File 'lib/torque/postgresql/adapter/schema_definitions.rb', line 26 def enum_set(*args, **) super(*args, **.merge(array: true)) end |
#interval(*args, **options) ⇒ Object
Creates a column with an interval type, allowing span of times and dates to be stored without having to store a seconds-based integer or any sort of other approach
11 12 13 |
# File 'lib/torque/postgresql/adapter/schema_definitions.rb', line 11 def interval(*args, **) args.each { |name| column(name, :interval, **) } end |