Skip to content

Commit

Permalink
Fix slow migration (#241)
Browse files Browse the repository at this point in the history
* Fix slow migration of published_at field
  • Loading branch information
mgdigital committed Apr 21, 2024
1 parent ccbefc1 commit a161144
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions migrations/00017_ordering_fields.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ alter table torrents_torrent_sources drop column bfpe;
alter table torrent_contents add column seeders integer;
alter table torrent_contents add column leechers integer;

alter table torrent_contents add column published_at timestamp with time zone;
update torrent_contents set published_at = created_at;
alter table torrent_contents alter column published_at set not null;
alter table torrent_contents add column published_at timestamp with time zone not null default '1999-01-01 00:00:00+00';
alter table torrent_contents alter column published_at drop default;

create index on torrent_contents (seeders);
create index on torrent_contents (leechers);
Expand Down

0 comments on commit a161144

Please sign in to comment.