mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
Allow pgcrypto extension to preexist (#1114)
The CREATE EXTENSION query requires superuser privileges, which means that the Firezone container may not be allowed to execute it when accessing an externally hosted database, resulting in the database failing to initialise properly. One potential workaround to this problem is to have the database admin ascertain that the pgcrypto extension is already present and ready for use, prior to starting the Firezone container for the first time. Unfortunately, however, this currently fails in the following manner: 14:42:44.731 [info] execute "CREATE EXTENSION pgcrypto" ** (Postgrex.Error) ERROR 42710 (duplicate_object) extension "pgcrypto" already exists Adding the IF NOT EXISTS condition to the CREATE EXTENSION query should allow it to succeed.
This commit is contained in:
@@ -3,7 +3,7 @@ defmodule FzHttp.Repo.Migrations.AddUuids do
|
||||
|
||||
def change do
|
||||
execute(
|
||||
"CREATE EXTENSION pgcrypto",
|
||||
"CREATE EXTENSION IF NOT EXISTS pgcrypto",
|
||||
"DROP EXTENSION pgcrypto"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user