module ActiveRecord::ConnectionAdapters::SchemaStatements
Public Instance Methods
create_table(table_name, options = {}, &block)
click to toggle source
# File lib/activerecord-multi-tenant/migrations.rb, line 46 def create_table(table_name, options = {}, &block) ret = orig_create_table(table_name, **options.except(:partition_key), &block) if options[:partition_key] && options[:partition_key].to_s != 'id' execute "ALTER TABLE #{table_name} DROP CONSTRAINT #{table_name}_pkey" execute "ALTER TABLE #{table_name} ADD PRIMARY KEY(\"#{options[:partition_key]}\", id)" end ret end
Also aliased as: orig_create_table