aliases/implications: remove 'pending' state.

Remove the pending status from tag aliases and implications.

Previously aliases would be created first in the pending state then
changed to active when the alias was later processed in a delayed job.
This meant that BURs weren't processed completely sequentially; first
all the aliases in a BUR would be created in one go, then later they
would be processed and set to active sequentially.

This was problematic in complex BURs that tried to reverse or swap
around aliases, since new pending aliases could be created before old
conflicting aliases were removed.
This commit is contained in:
evazion
2020-12-01 15:30:42 -06:00
parent 45d050d918
commit 8717c319ab
19 changed files with 70 additions and 114 deletions

View File

@@ -2857,7 +2857,7 @@ CREATE TABLE public.tag_aliases (
consequent_name character varying NOT NULL,
creator_id integer NOT NULL,
forum_topic_id integer,
status text DEFAULT 'pending'::text NOT NULL,
status text DEFAULT 'active'::text NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
approver_id integer,
@@ -2894,7 +2894,7 @@ CREATE TABLE public.tag_implications (
consequent_name character varying NOT NULL,
creator_id integer NOT NULL,
forum_topic_id integer,
status text DEFAULT 'pending'::text NOT NULL,
status text DEFAULT 'active'::text NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
approver_id integer,
@@ -7419,6 +7419,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20200427190519'),
('20200520060951'),
('20200803022359'),
('20200816175151');
('20200816175151'),
('20201201211748');