sea-orm/sea-orm-cli/Cargo.toml
Viktor Bahr 3518acf1b9
CLI command to generate a new migration (#656)
* feat(cli): add 'migration generate' subcommand

This subcommend will create a new, empty migration.

* feat(deps): add chrono crate

This crate will allow me to fetch the current date and time required for
generating the migration filename.

* feat(cli): generate migration filename

* feat(cli): read template, replace migration name

* feat(cli): write modified content to file

* feat(deps): add regex crate

Allows me to parse the lib.rs file containing the migrator logic.

* fix(cli): add missing chrono import

* feat(cli): mod declaration for new migration

This modifies the existing migator file, adding a module declaration for
the newly generated migration.

* feat(cli): regenerate migration vector

* feat(cli): write updated migrator file to disk

This completes updating the migrator file with the new migration
information.

* docs(cli): additional docstring

* refactor(cli): move logic into functions

* test(cli): create new migration happy path

* test(cli): update migrator happy path

* fix(cli): dedicated tmp dir for test

This avoids conflicts with the other tests.

* style(cli): align generated code with cargofmt

As suggested by @billy1624 in the review of #656.

* feat(cli): harden regex against extra spaces

As suggested by @billy1624 in the review of #656.

Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
2022-05-09 21:31:12 +08:00

56 lines
1.9 KiB
TOML

[workspace]
# A separate workspace
[package]
name = "sea-orm-cli"
version = "0.7.2"
authors = [ "Billy Chan <ccw.billy.123@gmail.com>" ]
edition = "2021"
description = "Command line utility for SeaORM"
license = "MIT OR Apache-2.0"
documentation = "https://docs.rs/sea-orm"
repository = "https://github.com/SeaQL/sea-orm"
categories = [ "database" ]
keywords = ["async", "orm", "mysql", "postgres", "sqlite"]
default-run = "sea-orm-cli"
[lib]
name = "sea_orm_cli"
path = "src/lib.rs"
[[bin]]
name = "sea-orm-cli"
path = "src/bin/main.rs"
required-features = ["codegen"]
[[bin]]
name = "sea"
path = "src/bin/sea.rs"
required-features = ["codegen"]
[dependencies]
clap = { version = "^2.33.3" }
dotenv = { version = "^0.15" }
async-std = { version = "^1.9", features = [ "attributes", "tokio1" ] }
sea-orm-codegen = { version = "^0.7.0", path = "../sea-orm-codegen", optional = true }
sea-schema = { version = "^0.8.0" }
sqlx = { version = "^0.5", default-features = false, features = [ "mysql", "postgres" ], optional = true }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tracing = { version = "0.1" }
url = "^2.2"
chrono = "0.4"
regex = "1"
[dev-dependencies]
smol = "1.2.5"
[features]
default = [ "codegen", "runtime-async-std-native-tls" ]
codegen = [ "sea-schema/sqlx-all", "sea-orm-codegen" ]
runtime-actix-native-tls = [ "sqlx/runtime-actix-native-tls", "sea-schema/runtime-actix-native-tls" ]
runtime-async-std-native-tls = [ "sqlx/runtime-async-std-native-tls", "sea-schema/runtime-async-std-native-tls" ]
runtime-tokio-native-tls = [ "sqlx/runtime-tokio-native-tls", "sea-schema/runtime-tokio-native-tls" ]
runtime-actix-rustls = [ "sqlx/runtime-actix-rustls", "sea-schema/runtime-actix-rustls" ]
runtime-async-std-rustls = [ "sqlx/runtime-async-std-rustls", "sea-schema/runtime-async-std-rustls" ]
runtime-tokio-rustls = [ "sqlx/runtime-tokio-rustls", "sea-schema/runtime-tokio-rustls" ]