Skip to content

Commit 17fef4c

Browse files
Turbo87arlosi
andauthored
database: Add explicit_name column to dependencies table (#5091)
This can eventually be used to generate the index from the database. Co-authored-by: Arlo Siemsen <arsiem@microsoft.com>
1 parent 5522a10 commit 17fef4c

File tree

6 files changed

+13
-0
lines changed

6 files changed

+13
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE dependencies
2+
DROP COLUMN explicit_name;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE dependencies
2+
ADD COLUMN explicit_name VARCHAR NULL;

src/controllers/krate/publish.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ pub fn add_dependencies(
366366
default_features.eq(dep.default_features),
367367
features.eq(&dep.features),
368368
target.eq(dep.target.as_deref()),
369+
explicit_name.eq(dep.explicit_name_in_toml.as_deref())
369370
),
370371
))
371372
})

src/models/dependency.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub struct Dependency {
2020
pub features: Vec<String>,
2121
pub target: Option<String>,
2222
pub kind: DependencyKind,
23+
pub explicit_name: Option<String>,
2324
}
2425

2526
#[derive(Debug, QueryableByName)]

src/schema.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,12 @@ table! {
473473
///
474474
/// (Automatically generated by Diesel.)
475475
kind -> Int4,
476+
/// The `explicit_name` column of the `dependencies` table.
477+
///
478+
/// Its SQL type is `Nullable<Varchar>`.
479+
///
480+
/// (Automatically generated by Diesel.)
481+
explicit_name -> Nullable<Varchar>,
476482
}
477483
}
478484

src/worker/dump_db/dump-db.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ default_features = "public"
110110
features = "public"
111111
target = "public"
112112
kind = "public"
113+
explicit_name = "public"
113114

114115
[__diesel_schema_migrations.columns]
115116
version = "private"

0 commit comments

Comments
 (0)