Skip to content

database: Add explicit_name column to dependencies table #5091

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions migrations/2022-08-17-073805_explicit-name/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE dependencies
DROP COLUMN explicit_name;
2 changes: 2 additions & 0 deletions migrations/2022-08-17-073805_explicit-name/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE dependencies
ADD COLUMN explicit_name VARCHAR NULL;
1 change: 1 addition & 0 deletions src/controllers/krate/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ pub fn add_dependencies(
default_features.eq(dep.default_features),
features.eq(&dep.features),
target.eq(dep.target.as_deref()),
explicit_name.eq(dep.explicit_name_in_toml.as_deref())
),
))
})
Expand Down
1 change: 1 addition & 0 deletions src/models/dependency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub struct Dependency {
pub features: Vec<String>,
pub target: Option<String>,
pub kind: DependencyKind,
pub explicit_name: Option<String>,
}

#[derive(Debug, QueryableByName)]
Expand Down
6 changes: 6 additions & 0 deletions src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,12 @@ table! {
///
/// (Automatically generated by Diesel.)
kind -> Int4,
/// The `explicit_name` column of the `dependencies` table.
///
/// Its SQL type is `Nullable<Varchar>`.
///
/// (Automatically generated by Diesel.)
explicit_name -> Nullable<Varchar>,
}
}

Expand Down
1 change: 1 addition & 0 deletions src/worker/dump_db/dump-db.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ default_features = "public"
features = "public"
target = "public"
kind = "public"
explicit_name = "public"

[__diesel_schema_migrations.columns]
version = "private"
Expand Down