Skip to content

Commit a1ee21a

Browse files
Merge pull request #10778 from alphagov/migration-for-image-data
Add new fields to `ImageData`
2 parents 2846f68 + e024e2e commit a1ee21a

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class AddFieldsToImageData < ActiveRecord::Migration[8.0]
2+
def change
3+
safety_assured do
4+
change_table :image_data, bulk: true do |t|
5+
t.json :crop_data
6+
t.json :dimensions
7+
t.integer :replaced_by_id
8+
t.index :replaced_by_id
9+
end
10+
end
11+
end
12+
end

db/schema.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema[8.0].define(version: 2025_10_01_125325) do
13+
ActiveRecord::Schema[8.0].define(version: 2025_10_27_103851) do
1414
create_table "assets", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
1515
t.string "asset_manager_id", null: false
1616
t.string "variant", null: false
@@ -591,6 +591,10 @@
591591
t.datetime "created_at", precision: nil
592592
t.datetime "updated_at", precision: nil
593593
t.string "image_kind", default: "default", null: false
594+
t.json "crop_data"
595+
t.json "dimensions"
596+
t.integer "replaced_by_id"
597+
t.index ["replaced_by_id"], name: "index_image_data_on_replaced_by_id"
594598
end
595599

596600
create_table "images", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|

0 commit comments

Comments
 (0)