Migration: add country rules (#3834)

* Migration: add country rules

* Make `country_code` not nullable
pull/3828/head^2 r2024.02.27-373
hq1 3 years ago committed by GitHub
parent 8a8df685a7
commit b7b5dcf4c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -8,7 +8,7 @@ TOTP_VAULT_KEY=Q3BD4nddbkVJIPXgHuo5NthGKSIH0yesRfG05J88HIo=
ENVIRONMENT=dev
MAILER_ADAPTER=Bamboo.LocalAdapter
LOG_LEVEL=debug
SELFHOST=false
SELFHOST=true
DISABLE_CRON=true
ADMIN_USER_IDS=1
SHOW_CITIES=true

@ -0,0 +1,16 @@
defmodule Plausible.Repo.Migrations.ShieldCountryRules do
use Ecto.Migration
def change do
create table(:shield_rules_country, primary_key: false) do
add(:id, :uuid, primary_key: true)
add :site_id, references(:sites, on_delete: :delete_all), null: false
add :country_code, :text, null: false
add :action, :string, default: "deny", null: false
add :added_by, :string
timestamps()
end
create unique_index(:shield_rules_country, [:site_id, :country_code])
end
end
Loading…
Cancel
Save