File tree 4 files changed +17
-7
lines changed
migrations/2024-03-04-144536_remove-downloads-column
4 files changed +17
-7
lines changed Original file line number Diff line number Diff line change
1
+ alter table crates
2
+ add column downloads integer not null default 0 ;
3
+
4
+ create index concurrently index_crate_downloads
5
+ on crates (downloads);
6
+
7
+ create index concurrently index_crates_id_downloads_name
8
+ on crates (id, downloads, name);
9
+
10
+ -- The following query can take a couple of seconds so it should be run manually
11
+ -- outside of the migration to prevent the server from taking a long time to
12
+ -- start up while waiting for the migration to complete.
13
+
14
+ -- update crates
15
+ -- set downloads = (select downloads from crate_downloads where crate_downloads.crate_id = crates.id);
Original file line number Diff line number Diff line change
1
+ alter table crates
2
+ drop column downloads;
Original file line number Diff line number Diff line change @@ -315,12 +315,6 @@ diesel::table! {
315
315
///
316
316
/// (Automatically generated by Diesel.)
317
317
created_at -> Timestamp ,
318
- /// The `downloads` column of the `crates` table.
319
- ///
320
- /// Its SQL type is `Int4`.
321
- ///
322
- /// (Automatically generated by Diesel.)
323
- downloads -> Int4 ,
324
318
/// The `description` column of the `crates` table.
325
319
///
326
320
/// Its SQL type is `Nullable<Varchar>`.
Original file line number Diff line number Diff line change @@ -78,7 +78,6 @@ id = "public"
78
78
name = " public"
79
79
updated_at = " public"
80
80
created_at = " public"
81
- downloads = " public"
82
81
description = " public"
83
82
homepage = " public"
84
83
documentation = " public"
You can’t perform that action at this time.
0 commit comments