Skip to content

Commit

Permalink
Remove old YAML format for versions data
Browse files Browse the repository at this point in the history
We now use JSON to store all versions data, and have converted
the existing YAML into JSON. Remove the YAML copy of the old data.

Signed-off-by: David A. Wheeler <[email protected]>
  • Loading branch information
david-a-wheeler committed Dec 19, 2024
1 parent 9cb2be8 commit 06d28da
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
12 changes: 12 additions & 0 deletions db/migrate/20241219131058_remove_old_yaml_object_from_versions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

# Remove old_yaml_object. We now store version information in the
# column "object" in JSON format and we have converted all the data in
# YAML format to the JSON format. We *could* retain the YAML copy,
# but it takes up a lot of space for no gain.

class RemoveOldYamlObjectFromVersions < ActiveRecord::Migration[7.1]
def change
remove_column :versions, :old_yaml_object, :text
end
end
5 changes: 2 additions & 3 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.1].define(version: 2024_12_18_182207) do
ActiveRecord::Schema[7.1].define(version: 2024_12_19_131058) do
create_schema "heroku_ext"

# These are extensions that must be enabled in order to support this database
Expand All @@ -35,8 +35,8 @@

create_table "pg_search_documents", id: :serial, force: :cascade do |t|
t.text "content"
t.string "searchable_type"
t.integer "searchable_id"
t.string "searchable_type"
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.index ["searchable_type", "searchable_id"], name: "index_pg_search_documents_on_searchable_type_and_searchable_id"
Expand Down Expand Up @@ -437,7 +437,6 @@
t.integer "item_id", null: false
t.string "event", null: false
t.string "whodunnit"
t.text "old_yaml_object"
t.datetime "created_at", precision: nil
t.jsonb "object"
t.index ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"
Expand Down

0 comments on commit 06d28da

Please sign in to comment.