Log ID f58a7df8-7b8a-49ca-8175-7e90a2a76002 Log Timestamp (UTC) 2022-11-20T13:56:32.184Z Log Event Message {"level":"fatal","msg":"running db migrations: error executing migrations/20221003041349_add_mfa_schema.up.sql, sql: -- see: https://stackoverflow.com/questions/7624919/check-if-a-user-defined-type-already-exists-in-postgresql/48382296#48382296\ndo $$ begin\n create type factor_type as enum('totp', 'webauthn');\n create type factor_status as enum('unverified', 'verified');\n create type aal_level as enum('aal1', 'aal2', 'aal3');\nexception\n when duplicate_object then null;\nend $$;\n\n-- auth.mfa_factors definition\ncreate table if not exists auth.mfa_factors(\n id uuid not null,\n user_id uuid not null,\n friendly_name text null,\n factor_type factor_type not null,\n status factor_status not null,\n created_at timestamptz not null,\n updated_at timestamptz not null,\n secret text null,\n constraint mfa_factors_pkey primary key(id),\n constraint mfa_factors_user_id_fkey foreign key (user_id) references auth.users(id) on delete cascade\n);\ncomment on table auth.mfa_factors is 'auth: stores metadata about factors';\n\ncreate unique index mfa_factors_user_friendly_name_unique on auth.mfa_factors (friendly_name, user_id) where trim(friendly_name) \u003c\u003e '';\n\n-- auth.mfa_challenges definition\ncreate table if not exists auth.mfa_challenges(\n id uuid not null,\n factor_id uuid not null,\n created_at timestamptz not null,\n verified_at timestamptz null,\n ip_address inet not null,\n constraint mfa_challenges_pkey primary key (id),\n constraint mfa_challenges_auth_factor_id_fkey foreign key (factor_id) references auth.mfa_factors(id) on delete cascade\n);\ncomment on table auth.mfa_challenges is 'auth: stores metadata about challenge requests made';\n\n\n\n-- add factor_id and amr claims to session\ncreate table if not exists auth.mfa_amr_claims(\n session_id uuid not null,\n created_at timestamptz not null,\n updated_at timestamptz not null,\n authentication_method text not null,\n constraint mfa_amr_claims_session_id_authentication_method_pkey unique(session_id, authentication_method),\n constraint mfa_amr_claims_session_id_fkey foreign key(session_id) references auth.sessions(id) on delete cascade\n);\ncomment on table auth.mfa_amr_claims is 'auth: stores authenticator method reference claims for multi factor authentication';\n: ERROR: relation \"mfa_factors_user_friendly_name_unique\" already exists (SQLSTATE 42P07)","time":"2022-11-20T13:56:32Z"} Log Metadata [ { "__MONOTONIC_TIMESTAMP": null, "CODE_FUNC": null, "status": null, "_CMDLINE": null, "method": null, "_SYSTEMD_CGROUP": null, "CODE_FILE": null, "EXECUTABLE": null, "_EXE": null, "UNIT": null, "level": null, "_COMM": null, "duration": null, "_LINE_BREAK": null, "_SOURCE_REALTIME_TIMESTAMP": null, "_UID": null, "host": "db-bjtejrqbjqlmhbpypytp", "PRIORITY": null, "_CAP_EFFECTIVE": null, "_PID": null, "INVOCATION_ID": null, "_SYSTEMD_UNIT": null, "source_type": "journald", "SYSLOG_FACILITY": null, "request_id": null, "CODE_LINE": null, "path": null, "component": null, "project": "bjtejrqbjqlmhbpypytp", "referer": null, "remote_addr": null, "_SYSTEMD_SLICE": null, "_SYSTEMD_INVOCATION_ID": null, "_MACHINE_ID": null, "_TRANSPORT": null, "_SELINUX_CONTEXT": null, "MESSAGE_ID": null, "__REALTIME_TIMESTAMP": null, "_STREAM_ID": null, "_GID": null, "_BOOT_ID": null, "SYSLOG_IDENTIFIER": null } ]