Skip to content

Update database schema to match the code #1133

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
Oct 24, 2017
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
3 changes: 3 additions & 0 deletions migrations/2017-10-16-200404_stop_lying_to_schema/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE crates ADD COLUMN max_version VARCHAR;
ALTER TABLE crates ALTER COLUMN textsearchable_index_col DROP NOT NULL;
ALTER TABLE users ADD COLUMN api_token VARCHAR NOT NULL DEFAULT random_string(32);
3 changes: 3 additions & 0 deletions migrations/2017-10-16-200404_stop_lying_to_schema/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE crates DROP COLUMN max_version;
ALTER TABLE crates ALTER COLUMN textsearchable_index_col SET NOT NULL;
ALTER TABLE users DROP COLUMN api_token;
7 changes: 5 additions & 2 deletions src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ table! {
}

table! {
use diesel_full_text_search::{TsVector as Tsvector};
use diesel::types::*;

/// Representation of the `crates` table.
///
/// (Automatically generated by Diesel.)
Expand Down Expand Up @@ -281,10 +284,10 @@ table! {
readme -> Nullable<Varchar>,
/// The `textsearchable_index_col` column of the `crates` table.
///
/// Its SQL type is `TsVector`.
/// Its SQL type is `Tsvector`.
///
/// (Automatically generated by Diesel.)
textsearchable_index_col -> ::diesel_full_text_search::TsVector,
textsearchable_index_col -> Tsvector,
/// The `license` column of the `crates` table.
///
/// Its SQL type is `Nullable<Varchar>`.
Expand Down