delayed jobs: add indices in db.
This commit is contained in:
12
db/migrate/20190827014726_add_indices_to_delayed_jobs.rb
Normal file
12
db/migrate/20190827014726_add_indices_to_delayed_jobs.rb
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
class AddIndicesToDelayedJobs < ActiveRecord::Migration[6.0]
|
||||||
|
def up
|
||||||
|
# the production db already has this index.
|
||||||
|
add_index :delayed_jobs, :locked_at unless index_exists?(:delayed_jobs, :locked_at)
|
||||||
|
add_index :delayed_jobs, :locked_by unless index_exists?(:delayed_jobs, :locked_by)
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
remove_index :delayed_jobs, :locked_at if index_exists?(:delayed_jobs, :locked_at)
|
||||||
|
remove_index :delayed_jobs, :locked_by if index_exists?(:delayed_jobs, :locked_by)
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -5089,6 +5089,20 @@ CREATE INDEX index_comments_on_creator_ip_addr ON public.comments USING btree (c
|
|||||||
CREATE INDEX index_comments_on_post_id ON public.comments USING btree (post_id);
|
CREATE INDEX index_comments_on_post_id ON public.comments USING btree (post_id);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: index_delayed_jobs_on_locked_at; Type: INDEX; Schema: public; Owner: -
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE INDEX index_delayed_jobs_on_locked_at ON public.delayed_jobs USING btree (locked_at);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: index_delayed_jobs_on_locked_by; Type: INDEX; Schema: public; Owner: -
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE INDEX index_delayed_jobs_on_locked_by ON public.delayed_jobs USING btree (locked_by);
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Name: index_delayed_jobs_on_run_at; Type: INDEX; Schema: public; Owner: -
|
-- Name: index_delayed_jobs_on_run_at; Type: INDEX; Schema: public; Owner: -
|
||||||
--
|
--
|
||||||
@@ -7530,6 +7544,7 @@ INSERT INTO "schema_migrations" (version) VALUES
|
|||||||
('20190109210822'),
|
('20190109210822'),
|
||||||
('20190129012253'),
|
('20190129012253'),
|
||||||
('20190712174818'),
|
('20190712174818'),
|
||||||
('20190827013252');
|
('20190827013252'),
|
||||||
|
('20190827014726');
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user