Skip to content

Commit

Permalink
versions: Adjust checksum column to be NOT NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed Aug 28, 2022
1 parent 4b0de59 commit 3327176
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions migrations/2022-08-28-191319_non-null-checksum/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table versions
alter column checksum drop not null;
2 changes: 2 additions & 0 deletions migrations/2022-08-28-191319_non-null-checksum/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table versions
alter column checksum set not null;
2 changes: 1 addition & 1 deletion src/models/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub struct Version {
pub license: Option<String>,
pub crate_size: Option<i32>,
pub published_by: Option<i32>,
pub checksum: Option<String>,
pub checksum: String,
pub links: Option<String>,
}

Expand Down
4 changes: 2 additions & 2 deletions src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -990,10 +990,10 @@ table! {
published_by -> Nullable<Int4>,
/// The `checksum` column of the `versions` table.
///
/// Its SQL type is `Nullable<Bpchar>`.
/// Its SQL type is `Bpchar`.
///
/// (Automatically generated by Diesel.)
checksum -> Nullable<Bpchar>,
checksum -> Bpchar,
/// The `links` column of the `versions` table.
///
/// Its SQL type is `Nullable<Varchar>`.
Expand Down

0 comments on commit 3327176

Please sign in to comment.