mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-27 17:30:32 +08:00
Remove the deprecated foreign keys from TinyMceAsset [SCI-3839]
This commit is contained in:
parent
835410a3d8
commit
efe5d8a6ea
3 changed files with 10 additions and 22 deletions
|
@ -11,11 +11,6 @@ class TinyMceAsset < ApplicationRecord
|
||||||
after_destroy :release_team_space
|
after_destroy :release_team_space
|
||||||
|
|
||||||
belongs_to :team, inverse_of: :tiny_mce_assets, optional: true
|
belongs_to :team, inverse_of: :tiny_mce_assets, optional: true
|
||||||
belongs_to :step, inverse_of: :tiny_mce_assets, touch: true, optional: true
|
|
||||||
belongs_to :result_text,
|
|
||||||
inverse_of: :tiny_mce_assets,
|
|
||||||
touch: true,
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
belongs_to :object, polymorphic: true,
|
belongs_to :object, polymorphic: true,
|
||||||
optional: true,
|
optional: true,
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class RemoveUnusedReferencesFromTinyMceAssets < ActiveRecord::Migration[6.0]
|
||||||
|
def change
|
||||||
|
remove_reference :tiny_mce_assets, :result_text, index: true
|
||||||
|
remove_reference :tiny_mce_assets, :step, index: true
|
||||||
|
end
|
||||||
|
end
|
|
@ -2088,9 +2088,7 @@ CREATE TABLE public.tiny_mce_assets (
|
||||||
image_file_size bigint,
|
image_file_size bigint,
|
||||||
image_updated_at timestamp without time zone,
|
image_updated_at timestamp without time zone,
|
||||||
estimated_size integer DEFAULT 0 NOT NULL,
|
estimated_size integer DEFAULT 0 NOT NULL,
|
||||||
step_id integer,
|
|
||||||
team_id integer,
|
team_id integer,
|
||||||
result_text_id integer,
|
|
||||||
created_at timestamp without time zone NOT NULL,
|
created_at timestamp without time zone NOT NULL,
|
||||||
updated_at timestamp without time zone NOT NULL,
|
updated_at timestamp without time zone NOT NULL,
|
||||||
saved boolean DEFAULT true,
|
saved boolean DEFAULT true,
|
||||||
|
@ -4973,20 +4971,6 @@ CREATE INDEX index_teams_on_name ON public.teams USING btree (name);
|
||||||
CREATE INDEX index_tiny_mce_assets_on_object_type_and_object_id ON public.tiny_mce_assets USING btree (object_type, object_id);
|
CREATE INDEX index_tiny_mce_assets_on_object_type_and_object_id ON public.tiny_mce_assets USING btree (object_type, object_id);
|
||||||
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Name: index_tiny_mce_assets_on_result_text_id; Type: INDEX; Schema: public; Owner: -
|
|
||||||
--
|
|
||||||
|
|
||||||
CREATE INDEX index_tiny_mce_assets_on_result_text_id ON public.tiny_mce_assets USING btree (result_text_id);
|
|
||||||
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Name: index_tiny_mce_assets_on_step_id; Type: INDEX; Schema: public; Owner: -
|
|
||||||
--
|
|
||||||
|
|
||||||
CREATE INDEX index_tiny_mce_assets_on_step_id ON public.tiny_mce_assets USING btree (step_id);
|
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Name: index_tiny_mce_assets_on_team_id; Type: INDEX; Schema: public; Owner: -
|
-- Name: index_tiny_mce_assets_on_team_id; Type: INDEX; Schema: public; Owner: -
|
||||||
--
|
--
|
||||||
|
@ -6535,6 +6519,7 @@ INSERT INTO "schema_migrations" (version) VALUES
|
||||||
('20190812065432'),
|
('20190812065432'),
|
||||||
('20190812072649'),
|
('20190812072649'),
|
||||||
('20190830141257'),
|
('20190830141257'),
|
||||||
('20190910125740');
|
('20190910125740'),
|
||||||
|
('20191001133557');
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue