Module: Tablature::Statements
- Defined in:
- lib/tablature/statements.rb
Overview
Methods that are made available in migrations.
Instance Method Summary collapse
-
#create_list_partition(name, options) {|td| ... } ⇒ Object
Creates a partitioned table using the list partition method.
-
#create_list_partition_of(parent_table_name, options) ⇒ Object
Creates a partition of a parent by specifying the key values appearing in the partition.
-
#create_range_partition(name, options) {|td| ... } ⇒ Object
Creates a partitioned table using the range partition method.
-
#create_range_partition_of(parent_table, options) ⇒ Object
Creates a partition of a parent by specifying the key values appearing in the partition.
Instance Method Details
#create_list_partition(name, options) {|td| ... } ⇒ Object
Creates a partitioned table using the list partition method.
11 12 13 14 15 |
# File 'lib/tablature/statements.rb', line 11 def create_list_partition(name, , &block) raise ArgumentError, 'partition_key must be defined' if [:partition_key].nil? Tablature.database.create_list_partition(name, , &block) end |
#create_list_partition_of(parent_table_name, options) ⇒ Object
Creates a partition of a parent by specifying the key values appearing in the partition.
23 24 25 26 27 |
# File 'lib/tablature/statements.rb', line 23 def create_list_partition_of(parent_table_name, ) raise ArgumentError, 'values must be defined' if [:values].nil? Tablature.database.create_list_partition_of(parent_table_name, ) end |
#create_range_partition(name, options) {|td| ... } ⇒ Object
Creates a partitioned table using the range partition method.
37 38 39 40 41 |
# File 'lib/tablature/statements.rb', line 37 def create_range_partition(name, , &block) raise ArgumentError, 'partition_key must be defined' if [:partition_key].nil? Tablature.database.create_range_partition(name, , &block) end |
#create_range_partition_of(parent_table, options) ⇒ Object
Creates a partition of a parent by specifying the key values appearing in the partition.
49 50 51 52 53 54 55 |
# File 'lib/tablature/statements.rb', line 49 def create_range_partition_of(parent_table, ) if [:range_start].nil? || [:range_end].nil? raise ArgumentError, 'range_start and range_end must be defined' end Tablature.database.create_range_partition_of(parent_table, ) end |