Skip to content

Commit ddb6df0

Browse files
committed
database: Remove crates.downloads column
1 parent 19c54b7 commit ddb6df0

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
alter table crates
2+
add column downloads integer not null default 0;
3+
4+
-- The following query can take a couple of seconds so it should be run manually
5+
-- outside of the migration to prevent the server from taking a long time to
6+
-- start up while waiting for the migration to complete.
7+
8+
-- update crates
9+
-- set downloads = (select downloads from crate_downloads where crate_downloads.crate_id = crates.id);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
alter table crates
2+
drop column downloads;

src/schema.rs

-6
Original file line numberDiff line numberDiff line change
@@ -315,12 +315,6 @@ diesel::table! {
315315
///
316316
/// (Automatically generated by Diesel.)
317317
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,
324318
/// The `description` column of the `crates` table.
325319
///
326320
/// Its SQL type is `Nullable<Varchar>`.

src/worker/jobs/dump_db/dump-db.toml

-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ id = "public"
7878
name = "public"
7979
updated_at = "public"
8080
created_at = "public"
81-
downloads = "public"
8281
description = "public"
8382
homepage = "public"
8483
documentation = "public"

0 commit comments

Comments
 (0)