From 35ab71b01a75b2b8024d7498591f03e643f89125 Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis <94526761+natdeanlewissoftwire@users.noreply.github.com> Date: Tue, 21 Jul 2026 11:07:21 +0100 Subject: [PATCH] CLDC-4497: Allow users with no role to download data (#3360) --- .../20260713105230_allow_null_role_in_download_records.rb | 5 +++++ db/schema.rb | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20260713105230_allow_null_role_in_download_records.rb diff --git a/db/migrate/20260713105230_allow_null_role_in_download_records.rb b/db/migrate/20260713105230_allow_null_role_in_download_records.rb new file mode 100644 index 000000000..bf78a91b8 --- /dev/null +++ b/db/migrate/20260713105230_allow_null_role_in_download_records.rb @@ -0,0 +1,5 @@ +class AllowNullRoleInDownloadRecords < ActiveRecord::Migration[7.2] + def change + change_column_null :download_records, :user_role, true + end +end diff --git a/db/schema.rb b/db/schema.rb index 5f73c8068..28a587569 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.2].define(version: 2026_06_18_101455) do +ActiveRecord::Schema[7.2].define(version: 2026_07_13_105230) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -111,7 +111,7 @@ ActiveRecord::Schema[7.2].define(version: 2026_06_18_101455) do t.string "download_filters", null: false t.bigint "user_id", null: false t.bigint "user_organisation_id", null: false - t.integer "user_role", null: false + t.integer "user_role" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["user_id"], name: "index_download_records_on_user_id"