From c4afcbb77ecaa57534bdf4c827bd8fcdd23b505a Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Wed, 2 Jun 2021 11:48:02 +0200 Subject: [PATCH] plausible: remove create extension patch Turns out this isn't needed if the module correctly adds the `citext` extension to the `plausible` database. --- pkgs/servers/web-apps/plausible/default.nix | 8 ++++---- .../web-apps/plausible/skip-create-ext.patch | 16 ---------------- 2 files changed, 4 insertions(+), 20 deletions(-) delete mode 100644 pkgs/servers/web-apps/plausible/skip-create-ext.patch diff --git a/pkgs/servers/web-apps/plausible/default.nix b/pkgs/servers/web-apps/plausible/default.nix index c1cafb49d6a..bf408551a44 100644 --- a/pkgs/servers/web-apps/plausible/default.nix +++ b/pkgs/servers/web-apps/plausible/default.nix @@ -27,6 +27,10 @@ let pname = "${pname}-deps"; inherit src version; sha256 = "18h3hs69nw06msvs3nnymf6p94qd3x1f4d2zawqriy9fr5fz7zx6"; + + # We need ecto 3.6 as this version checks whether the database exists before + # trying to create it. The creation attempt would always require super-user privileges + # and since 3.6 this isn't the case anymore. patches = [ ./ecto_sql-fix.patch ]; }; @@ -62,10 +66,6 @@ beamPackages.mixRelease { # Ensure that `tzdata` doesn't write into its store-path # https://github.com/plausible/analytics/pull/1096, but rebased onto 1.3.0 ./tzdata-rebased.patch - - # CREATE EXTENSION requires super-user privileges. To avoid that, we just skip - # the responsible SQL statement here and take care of it in the module. - ./skip-create-ext.patch ]; passthru = { diff --git a/pkgs/servers/web-apps/plausible/skip-create-ext.patch b/pkgs/servers/web-apps/plausible/skip-create-ext.patch deleted file mode 100644 index ad9defadf9a..00000000000 --- a/pkgs/servers/web-apps/plausible/skip-create-ext.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/priv/repo/migrations/20190430140411_use_citext_for_email.exs b/priv/repo/migrations/20190430140411_use_citext_for_email.exs -index ecb6f80..f3bf12f 100644 ---- a/priv/repo/migrations/20190430140411_use_citext_for_email.exs -+++ b/priv/repo/migrations/20190430140411_use_citext_for_email.exs -@@ -2,10 +2,6 @@ defmodule Plausible.Repo.Migrations.UseCitextForEmail do - use Ecto.Migration - - def change do -- execute "CREATE EXTENSION IF NOT EXISTS citext;" -- -- alter table(:users) do -- modify :email, :citext, null: false -- end -+ execute "ALTER TABLE users ALTER COLUMN email TYPE citext;" - end - end