Skip to content

Fix diesel schema patch file update instructions #11053

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
Apr 23, 2025
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
9 changes: 5 additions & 4 deletions crates/crates_io_database/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ regular tables, so we have to manually add them to the schema file.
If you need to update the patch file, you can do so by following these steps:

1. prefix `patch_file = "src/schema.patch"` in `diesel.toml` with a `#` to comment it out.
2. use `diesel print-schema` and save the output to `src/schema.rs.orig`
3. use `patch -o src/schema.rs src/schema.rs.orig src/schema.patch` to apply the patch file and solve remaining issues in the `src/schema.rs` file
4. use `diff -Naur src/schema.rs.orig src/schema.rs` to generate the new content for the `src/schema.patch` file
5. enable the `patch_file` option in the `diesel.toml` file again.
2. use `diesel print-schema` and save the output to `src/schema.rs`
3. use `cp src/schema.rs src/schema.rs.orig` to create a backup of the original file
4. use `patch src/schema.rs src/schema.patch` to apply the patch file and solve remaining issues in the `src/schema.rs` file
5. use `diff -Naur --label original --label patched src/schema.rs.orig src/schema.rs` to generate the new content for the `src/schema.patch` file
6. enable the `patch_file` option in the `diesel.toml` file again.
4 changes: 2 additions & 2 deletions crates/crates_io_database/src/schema.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- crates/crates_io_database/schema.rs.orig 2024-03-04 10:34:35
+++ crates/crates_io_database/schema.rs 2024-03-04 10:33:35
--- original
+++ patched
@@ -21,9 +21,7 @@
/// The `pg_catalog.tsvector` SQL type
///
Expand Down