From 67d8f685dd3bb082c6a413e122663b1376b73d3c Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Thu, 22 Aug 2024 18:19:58 +0200 Subject: [PATCH] delete unwanted migration file --- ...d_encrypted_metadata_to_authorizations.decidim.rb | 12 ------------ db/schema.rb | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 db/migrate/20200218144732_add_encrypted_metadata_to_authorizations.decidim.rb diff --git a/db/migrate/20200218144732_add_encrypted_metadata_to_authorizations.decidim.rb b/db/migrate/20200218144732_add_encrypted_metadata_to_authorizations.decidim.rb deleted file mode 100644 index 05876d9..0000000 --- a/db/migrate/20200218144732_add_encrypted_metadata_to_authorizations.decidim.rb +++ /dev/null @@ -1,12 +0,0 @@ -# This migration comes from decidim (originally 20191004194247) -class AddEncryptedMetadataToAuthorizations < ActiveRecord::Migration[5.2] - def change - add_column :decidim_authorizations, :encrypted_metadata, :text - Decidim::Authorization.find_each do |authorization| - authorization.encrypted_metadata = Decidim::MetadataEncryptor.new( - uid: authorization.unique_id - ).encrypt(authorization.metadata) - end - remove_column :decidim_authorizations, :metadata - end -end diff --git a/db/schema.rb b/db/schema.rb index d133e9d..1435202 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -280,6 +280,7 @@ create_table "decidim_authorizations", id: :serial, force: :cascade do |t| t.string "name", null: false + t.jsonb "metadata" t.integer "decidim_user_id", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false @@ -287,7 +288,6 @@ t.datetime "granted_at" t.jsonb "verification_metadata", default: {} t.string "verification_attachment" - t.text "encrypted_metadata" t.index ["decidim_user_id", "name"], name: "index_decidim_authorizations_on_decidim_user_id_and_name", unique: true t.index ["decidim_user_id"], name: "index_decidim_authorizations_on_decidim_user_id" t.index ["unique_id"], name: "index_decidim_authorizations_on_unique_id"