From 0b8cfa1385fef6595340f7b77332676c734a2bbe Mon Sep 17 00:00:00 2001 From: Alex Tavarez Date: Tue, 2 Sep 2025 18:11:13 -0400 Subject: [PATCH] Added additional columns to user table --- ...0250820154151_user_add_totp_secret_column.exs | 12 ++++++++++++ ...0250820173517_user_add_multifactor_column.exs | 14 ++++++++++++++ ...0820182412_user_remove_multifactor_column.exs | 13 +++++++++++++ ...83751_user_replace_otpfido_status_columns.exs | 16 ++++++++++++++++ .../20250820214257_user_add_user_u2f_columns.exs | 11 +++++++++++ .../20250820230021_remove_user_u2f_columns.exs | 11 +++++++++++ 6 files changed, 77 insertions(+) create mode 100644 priv/repo/migrations/20250820154151_user_add_totp_secret_column.exs create mode 100644 priv/repo/migrations/20250820173517_user_add_multifactor_column.exs create mode 100644 priv/repo/migrations/20250820182412_user_remove_multifactor_column.exs create mode 100644 priv/repo/migrations/20250820183751_user_replace_otpfido_status_columns.exs create mode 100644 priv/repo/migrations/20250820214257_user_add_user_u2f_columns.exs create mode 100644 priv/repo/migrations/20250820230021_remove_user_u2f_columns.exs diff --git a/priv/repo/migrations/20250820154151_user_add_totp_secret_column.exs b/priv/repo/migrations/20250820154151_user_add_totp_secret_column.exs new file mode 100644 index 0000000..1f14262 --- /dev/null +++ b/priv/repo/migrations/20250820154151_user_add_totp_secret_column.exs @@ -0,0 +1,12 @@ +defmodule Sukaato.Repo.Migrations.UserAddTotpSecretColumn do + use Ecto.Migration + + def change do + alter table("users") do + add :totp_secret, :string + add :ltotp, :utc_datetime + add :fido_cred, :string + add :fido_key, :map + end + end +end diff --git a/priv/repo/migrations/20250820173517_user_add_multifactor_column.exs b/priv/repo/migrations/20250820173517_user_add_multifactor_column.exs new file mode 100644 index 0000000..28b10ea --- /dev/null +++ b/priv/repo/migrations/20250820173517_user_add_multifactor_column.exs @@ -0,0 +1,14 @@ +defmodule Sukaato.Repo.Migrations.UserAddMultifactorColumn do + use Ecto.Migration + + def change do + alter table("users") do + add :multifactor, {:array, :integer}, default: [-1, -1, -1] + add :fido_priority, :integer + remove :fido_cred + add :fido_creds, {:array, :string} + remove :fido_key + add :fido_keys, {:array, :map} + end + end +end diff --git a/priv/repo/migrations/20250820182412_user_remove_multifactor_column.exs b/priv/repo/migrations/20250820182412_user_remove_multifactor_column.exs new file mode 100644 index 0000000..32af289 --- /dev/null +++ b/priv/repo/migrations/20250820182412_user_remove_multifactor_column.exs @@ -0,0 +1,13 @@ +defmodule Sukaato.Repo.Migrations.UserRemoveMultifactorColumn do + use Ecto.Migration + + def change do + alter table("users") do + remove :multifactor + add :fido_active, :boolean + add :totp_active, :boolean + add :fido_enabled, :boolean + add :totp_enabled, :boolean + end + end +end diff --git a/priv/repo/migrations/20250820183751_user_replace_otpfido_status_columns.exs b/priv/repo/migrations/20250820183751_user_replace_otpfido_status_columns.exs new file mode 100644 index 0000000..5a4bfaf --- /dev/null +++ b/priv/repo/migrations/20250820183751_user_replace_otpfido_status_columns.exs @@ -0,0 +1,16 @@ +defmodule Sukaato.Repo.Migrations.UserReplaceOtpfidoStatusColumns do + use Ecto.Migration + + def change do + alter table("users") do + remove :fido_active + add :fido_active, :boolean, default: false + remove :totp_active + add :totp_active, :boolean, default: true + remove :fido_enabled + add :fido_enabled, :boolean, default: false + remove :totp_enabled + add :totp_enabled, :boolean, default: false + end + end +end diff --git a/priv/repo/migrations/20250820214257_user_add_user_u2f_columns.exs b/priv/repo/migrations/20250820214257_user_add_user_u2f_columns.exs new file mode 100644 index 0000000..acf2fd7 --- /dev/null +++ b/priv/repo/migrations/20250820214257_user_add_user_u2f_columns.exs @@ -0,0 +1,11 @@ +defmodule Sukaato.Repo.Migrations.UserAddUserU2fColumns do + use Ecto.Migration + + def change do + alter table("users") do + add :u2f_enable, :boolean, default: false + add :u2f_priority, :integer + add :u2f_device, {:array, :map} + end + end +end diff --git a/priv/repo/migrations/20250820230021_remove_user_u2f_columns.exs b/priv/repo/migrations/20250820230021_remove_user_u2f_columns.exs new file mode 100644 index 0000000..06a5ebb --- /dev/null +++ b/priv/repo/migrations/20250820230021_remove_user_u2f_columns.exs @@ -0,0 +1,11 @@ +defmodule Sukaato.Repo.Migrations.RemoveUserU2fColumns do + use Ecto.Migration + + def change do + alter table("users") do + remove :u2f_enable + remove :u2f_priority + remove :u2f_device + end + end +end