Skip to content

Commit 113ed18

Browse files
committed
rerun if migrations.toml changed
1 parent e5d4453 commit 113ed18

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Unused or reverted migrations that are created during development can be manuall
146146
- On launch, versions of your binary built with a newer schema will automatically apply the appropriate migrations to an older database.
147147
- If you're feeling adventurous, you can add your own schema migration entries to the bottom of the list. (For creating indexes, etc.)
148148
- You can hand-write complex migrations as well, see [turbo/migrations.toml](https://github.com/trevyn/turbo-also-historical/blob/main/migrations.toml) for some examples.
149-
- Questions? Ask on Discord [https://discord.gg/RX3rTWUzUD](https://discord.gg/RX3rTWUzUD) or open a GitHub issue.
149+
- Please open a GitHub issue with any questions or suggestions!
150150

151151
## Where's my data?
152152

turbosql-impl/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -965,8 +965,7 @@ fn make_migrations(table: &Table) -> Vec<String> {
965965
}
966966

967967
fn migrations_toml_path() -> std::path::PathBuf {
968-
let mut path = std::path::PathBuf::new();
969-
path.push(env!("OUT_DIR"));
968+
let mut path = std::path::PathBuf::from(env!("OUT_DIR"));
970969
while path.file_name() != Some(std::ffi::OsStr::new("target")) {
971970
path.pop();
972971
}

turbosql/build.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
fn main() {
2-
let mut path = std::path::PathBuf::new();
3-
path.push(std::env::var_os("OUT_DIR").unwrap());
2+
let mut path = std::path::PathBuf::from(std::env::var_os("OUT_DIR").unwrap());
43
while path.file_name() != Some(std::ffi::OsStr::new("target")) {
54
path.pop();
65
}
76
path.pop();
87
path.push("migrations.toml");
98

10-
let mut path2 = std::path::PathBuf::new();
11-
path2.push(std::env::var_os("OUT_DIR").unwrap());
9+
println!("cargo:rerun-if-changed={}", path.to_str().unwrap());
10+
11+
let mut path2 = std::path::PathBuf::from(std::env::var_os("OUT_DIR").unwrap());
1212
path2.push("migrations.toml");
1313

1414
// docs.rs is a largely read-only filesystem

0 commit comments

Comments
 (0)