From cf61e47a0a27c1f6cff3bf826d442151625108c2 Mon Sep 17 00:00:00 2001 From: hq1 Date: Thu, 11 Apr 2024 12:00:01 +0200 Subject: [PATCH] Add shield hostname rules migration (#3992) --- .../20240407104659_shield_hostname_rules.exs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 priv/repo/migrations/20240407104659_shield_hostname_rules.exs diff --git a/priv/repo/migrations/20240407104659_shield_hostname_rules.exs b/priv/repo/migrations/20240407104659_shield_hostname_rules.exs new file mode 100644 index 000000000..12b452c95 --- /dev/null +++ b/priv/repo/migrations/20240407104659_shield_hostname_rules.exs @@ -0,0 +1,17 @@ +defmodule Plausible.Repo.Migrations.ShieldHostnameRules do + use Ecto.Migration + + def change do + create table(:shield_rules_hostname, primary_key: false) do + add(:id, :uuid, primary_key: true) + add :site_id, references(:sites, on_delete: :delete_all), null: false + add :hostname, :text, null: false + add :hostname_pattern, :text, null: false + add :action, :string, default: "allow", null: false + add :added_by, :string + timestamps() + end + + create unique_index(:shield_rules_hostname, [:site_id, :hostname_pattern]) + end +end