From 61477f1c2d9f0d4b6cd2a87c1c8534cf2a9131e4 Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis Date: Tue, 21 Jul 2026 14:47:21 +0100 Subject: [PATCH] Reapply "CLDC-4497: Allow users with no role to download data (#3360)" This reverts commit 862f641807ab7a195d98f9e3d9a30aee59d2572c. --- .../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"