mirror of
https://github.com/docusealco/docuseal
synced 2026-11-08 07:42:32 -05:00
19 lines
499 B
Ruby
19 lines
499 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AddSubmissionsAccountTemplateStatistics < ActiveRecord::Migration[8.1]
|
|
def up
|
|
return unless adapter_name == 'PostgreSQL'
|
|
|
|
execute <<~SQL.squish
|
|
CREATE STATISTICS IF NOT EXISTS submissions_account_template_stats (dependencies, ndistinct)
|
|
ON account_id, template_id FROM submissions
|
|
SQL
|
|
end
|
|
|
|
def down
|
|
return unless adapter_name == 'PostgreSQL'
|
|
|
|
execute 'DROP STATISTICS IF EXISTS submissions_account_template_stats'
|
|
end
|
|
end
|