From 33d771b166071969b493e83789f37463b6424d27 Mon Sep 17 00:00:00 2001 From: Joel Abshier Date: Sun, 3 Oct 2021 22:37:33 -0500 Subject: [PATCH] Add migration to enforce `user_id` on preferences --- priv/repo/migrations/20211004004848_require_user_id.exs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 priv/repo/migrations/20211004004848_require_user_id.exs diff --git a/priv/repo/migrations/20211004004848_require_user_id.exs b/priv/repo/migrations/20211004004848_require_user_id.exs new file mode 100644 index 0000000..82da4bf --- /dev/null +++ b/priv/repo/migrations/20211004004848_require_user_id.exs @@ -0,0 +1,9 @@ +defmodule UserPreferences.Repo.Migrations.RequireUserId do + use Ecto.Migration + + def change do + alter table(:preferences) do + modify :user_id, :integer, null: false + end + end +end