From 44116d116c1b8f8aeff15f15294149389d89a39a Mon Sep 17 00:00:00 2001 From: Angel Aviel Domaoan Date: Tue, 15 Feb 2022 03:02:45 +0000 Subject: [PATCH] Remove document in doctrines --- app/models/doctrine.rb | 2 -- ...319_remove_document_type_and_document_id_in_doctrines.rb | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20220215025319_remove_document_type_and_document_id_in_doctrines.rb diff --git a/app/models/doctrine.rb b/app/models/doctrine.rb index c0e4296..fd02a0d 100644 --- a/app/models/doctrine.rb +++ b/app/models/doctrine.rb @@ -1,6 +1,4 @@ class Doctrine < ApplicationRecord - belongs_to :document, polymorphic: true, optional: false - has_many :doctrine_jurisprudences, dependent: :destroy has_many :jurisprudences, through: :doctrine_jurisprudences diff --git a/db/migrate/20220215025319_remove_document_type_and_document_id_in_doctrines.rb b/db/migrate/20220215025319_remove_document_type_and_document_id_in_doctrines.rb new file mode 100644 index 0000000..b6063c2 --- /dev/null +++ b/db/migrate/20220215025319_remove_document_type_and_document_id_in_doctrines.rb @@ -0,0 +1,6 @@ +class RemoveDocumentTypeAndDocumentIdInDoctrines < ActiveRecord::Migration[6.1] + def up + remove_column :doctrines, :document_type, :string + remove_column :doctrines, :document_id, :integer + end +end