Skip to content

Commit 857eb04

Browse files
committed
feat: more work on ForeignKeys, add migration generation
1 parent 666fe7b commit 857eb04

32 files changed

+1126
-287
lines changed

Cargo.lock

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

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ log = "0.4"
5858
mime_guess = { version = "2", default-features = false }
5959
mockall = "0.13"
6060
password-auth = { version = "1.1.0-pre.1", default-features = false }
61+
petgraph = { version = "0.7", default-features = false }
6162
pin-project-lite = "0.2"
6263
prettyplease = "0.2"
6364
proc-macro-crate = "3"

flareon-cli/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ flareon.workspace = true
2020
flareon_codegen = { workspace = true, features = ["symbol-resolver"] }
2121
glob.workspace = true
2222
log.workspace = true
23+
petgraph.workspace = true
2324
prettyplease.workspace = true
2425
proc-macro2 = { workspace = true, features = ["span-locations"] }
2526
quote.workspace = true

flareon-cli/src/main.rs

+4-12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
extern crate core;
2+
13
mod migration_generator;
24
mod utils;
35

@@ -24,9 +26,6 @@ enum Commands {
2426
/// Path to the crate directory to generate migrations for (default:
2527
/// current directory)
2628
path: Option<PathBuf>,
27-
/// Name of the app to use in the migration (default: crate name)
28-
#[arg(long)]
29-
app_name: Option<String>,
3029
/// Directory to write the migrations to (default: migrations/ directory
3130
/// in the crate's src/ directory)
3231
#[arg(long)]
@@ -42,16 +41,9 @@ fn main() -> anyhow::Result<()> {
4241
.init();
4342

4443
match cli.command {
45-
Commands::MakeMigrations {
46-
path,
47-
app_name,
48-
output_dir,
49-
} => {
44+
Commands::MakeMigrations { path, output_dir } => {
5045
let path = path.unwrap_or_else(|| PathBuf::from("."));
51-
let options = MigrationGeneratorOptions {
52-
app_name,
53-
output_dir,
54-
};
46+
let options = MigrationGeneratorOptions { output_dir };
5547
make_migrations(&path, options).with_context(|| "unable to create migrations")?;
5648
}
5749
}

0 commit comments

Comments
 (0)