Skip to content

Commit 566c7be

Browse files
Merge #1133
1133: Update database schema to match the code r=carols10cents There are a handful of differences between what we say our schema is in the code, and what it actually is. These differences make schema.rs harder to regenerate, and can potentially lead to real issues down the line. This removes all of the differences between the real schema and what we say it is in Rust.
2 parents 601ed3c + 3f9416e commit 566c7be

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ALTER TABLE crates ADD COLUMN max_version VARCHAR;
2+
ALTER TABLE crates ALTER COLUMN textsearchable_index_col DROP NOT NULL;
3+
ALTER TABLE users ADD COLUMN api_token VARCHAR NOT NULL DEFAULT random_string(32);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ALTER TABLE crates DROP COLUMN max_version;
2+
ALTER TABLE crates ALTER COLUMN textsearchable_index_col SET NOT NULL;
3+
ALTER TABLE users DROP COLUMN api_token;

src/schema.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ table! {
221221
}
222222

223223
table! {
224+
use diesel_full_text_search::{TsVector as Tsvector};
225+
use diesel::types::*;
226+
224227
/// Representation of the `crates` table.
225228
///
226229
/// (Automatically generated by Diesel.)
@@ -281,10 +284,10 @@ table! {
281284
readme -> Nullable<Varchar>,
282285
/// The `textsearchable_index_col` column of the `crates` table.
283286
///
284-
/// Its SQL type is `TsVector`.
287+
/// Its SQL type is `Tsvector`.
285288
///
286289
/// (Automatically generated by Diesel.)
287-
textsearchable_index_col -> ::diesel_full_text_search::TsVector,
290+
textsearchable_index_col -> Tsvector,
288291
/// The `license` column of the `crates` table.
289292
///
290293
/// Its SQL type is `Nullable<Varchar>`.

0 commit comments

Comments
 (0)