mirror of https://github.com/docusealco/docuseal
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
499 B
19 lines
499 B
# 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
|