about summary refs log tree commit diff
path: root/db/migrate/20201206004238_create_instances.rb
blob: a4b866894ad8bf830b002f1e7ff339b7330a34ad (plain) (blame)
1
2
3
4
5
6
7
8
9
class CreateInstances < ActiveRecord::Migration[5.2]
  def change
    create_view :instances, materialized: true

    # To be able to refresh the view concurrently,
    # at least one unique index is required
    safety_assured { add_index :instances, :domain, unique: true }
  end
end