Sha256: e02d8676a95b018a49b919bff2e590b1aff36183a1629d9b7926987ed9565624
Contents?: true
Size: 1.37 KB
Versions: 1
Compression:
Stored size: 1.37 KB
Contents
require 'pg_partitioner/version' require 'pg_partitioner/separation_type/base' require 'pg_partitioner/separation_type/week' require 'pg_partitioner/separation_type/month' require 'pg_partitioner/separation_type/quater' module PgPartitioner def self.extended(base) base.extend( PgPartitioner::SeparationType::Base, PgPartitioner::SeparationType::Week, PgPartitioner::SeparationType::Month, PgPartitioner::SeparationType::Quater ) end # Template method # Column which will determine partition for row (must be date or datetime type). Default value is :created_at def parting_column :created_at end # Template method def partition_table_indexes; end def partition_table_named_indexes; end # Template method def partition_table_unique_indexes; end # Template method def partition_table_named_unique_indexes; end private def execute_sql(sql_string) connection.execute(sql_string) end def create_custom_index(table_name, index_fields, is_unique = false) connection.add_index table_name, index_fields, unique: is_unique end def create_custom_named_index(table_name, index_fields, name, is_unique = false) connection.add_index table_name, index_fields, name: name, unique: is_unique end def disable_autovacuum(table_name) execute_sql("ALTER TABLE #{table_name} SET (autovacuum_enabled = off);") end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
pg_partitioner-0.6.0 | lib/pg_partitioner.rb |