by descending post id

This commit is contained in:
Dylan Knutson
2025-08-13 08:18:47 +00:00
parent 6bb0b255fb
commit b33a267a83
13 changed files with 185 additions and 16 deletions

View File

@@ -0,0 +1,15 @@
class CreateIndexOnPostsPostedAtNullsLast < ActiveRecord::Migration[7.2]
def up
execute <<-SQL
CREATE INDEX index_domain_posts_on_posted_at_desc_nulls_last
ON domain_posts
USING BTREE
(posted_at DESC NULLS LAST)
SQL
end
def down
execute <<-SQL
DROP INDEX index_domain_posts_on_posted_at_desc_nulls_last
SQL
end
end

View File

@@ -4453,6 +4453,13 @@ CREATE INDEX index_domain_posts_ib_aux_on_ib_id ON public.domain_posts_ib_aux US
CREATE INDEX index_domain_posts_on_posted_at ON public.domain_posts USING btree (posted_at);
--
-- Name: index_domain_posts_on_posted_at_desc_nulls_last; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_domain_posts_on_posted_at_desc_nulls_last ON public.domain_posts USING btree (posted_at DESC NULLS LAST);
--
-- Name: index_domain_posts_on_type; Type: INDEX; Schema: public; Owner: -
--
@@ -5885,6 +5892,7 @@ ALTER TABLE ONLY public.domain_twitter_tweets
SET search_path TO "$user", public;
INSERT INTO "schema_migrations" (version) VALUES
('20250813000020'),
('20250812215907'),
('20250812214902'),
('20250812214415'),