Skip to content

Commit a2982a3

Browse files
committed
fix: generate down migrations correctly
1 parent cf175e8 commit a2982a3

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "sql-schema"
33
description = "Declarative SQL schema migrations"
44
keywords = ["sql", "schema", "migration", "migrations"]
55
categories = ["development-tools", "command-line-utilities", "database"]
6-
version = "0.2.0"
6+
version = "0.2.1"
77
edition = "2021"
88
license = "Apache-2.0"
99
authors = ["Jesse Stuart <[email protected]>"]

src/bin/sql-schema.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ fn run_migration(command: MigrationCommand) -> anyhow::Result<()> {
116116
.expect("system time should be after epoch")
117117
.as_secs();
118118
if opts.include_down {
119-
let down_migration = up_migration
120-
.diff(&SyntaxTree::empty())
121-
.unwrap_or_else(SyntaxTree::empty);
119+
let down_migration = schema.diff(&migrations).unwrap_or_else(SyntaxTree::empty);
122120

123121
write_migration(
124122
up_migration,

0 commit comments

Comments
 (0)