From f9ac0f5cf0293f784e6861607b3cf160053bde4a Mon Sep 17 00:00:00 2001 From: Jamie Benstead Date: Wed, 7 Oct 2026 14:23:01 +0100 Subject: [PATCH] Drop scratch_enabled column from schools --- app/models/school.rb | 2 -- .../20261007131211_remove_scratch_enabled_from_schools.rb | 7 +++++++ db/schema.rb | 3 +-- 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 db/migrate/20261007131211_remove_scratch_enabled_from_schools.rb diff --git a/app/models/school.rb b/app/models/school.rb index f6c42491a..c58aed310 100644 --- a/app/models/school.rb +++ b/app/models/school.rb @@ -2,8 +2,6 @@ class School < ApplicationRecord self.ignored_columns += [:creator_id] - # This is a temporary measure to allow the scratch_enabled column to be removed from the database without breaking the application. - self.ignored_columns += [:scratch_enabled] has_many :classes, class_name: :SchoolClass, inverse_of: :school, dependent: :destroy has_many :lessons, dependent: :nullify diff --git a/db/migrate/20261007131211_remove_scratch_enabled_from_schools.rb b/db/migrate/20261007131211_remove_scratch_enabled_from_schools.rb new file mode 100644 index 000000000..9fc8e8ae4 --- /dev/null +++ b/db/migrate/20261007131211_remove_scratch_enabled_from_schools.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class RemoveScratchEnabledFromSchools < ActiveRecord::Migration[8.1] + def change + remove_column :schools, :scratch_enabled, :boolean, default: false, null: false + end +end diff --git a/db/schema.rb b/db/schema.rb index 10401ac92..c7accc97b 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[8.1].define(version: 2026_09_15_100000) do +ActiveRecord::Schema[8.1].define(version: 2026_10_07_131211) do # These are extensions that must be enabled in order to support this database enable_extension "pg_catalog.plpgsql" enable_extension "pgcrypto" @@ -361,7 +361,6 @@ t.string "reference" t.datetime "rejected_at" t.string "school_roll_number" - t.boolean "scratch_enabled", default: false, null: false t.datetime "updated_at", null: false t.integer "user_origin", default: 0 t.datetime "verified_at"