Add CLI application with database migration and entity generation commands
- Introduced a new CLI application in the `apps/cli` directory. - Implemented commands for database migration and entity generation. - Updated `Cargo.toml` files to include necessary dependencies. - Enhanced the `justfile` to facilitate CLI command execution. - Modified workspace configuration to include the new CLI application.
This commit is contained in:
19
justfile
19
justfile
@@ -1,6 +1,15 @@
|
||||
set dotenv-load := true
|
||||
# development environment file
|
||||
set dotenv-filename := "./public/database/.env.generated"
|
||||
|
||||
cli *args:
|
||||
cd apps/cli && \
|
||||
if [ -n "{{args}}" ]; then \
|
||||
cargo run -- {{args}}; \
|
||||
else \
|
||||
cargo run; \
|
||||
fi
|
||||
|
||||
simulate *args:
|
||||
cd apps/container && \
|
||||
if [ -n "{{args}}" ]; then \
|
||||
@@ -29,11 +38,5 @@ migrate *args:
|
||||
fi
|
||||
|
||||
generate-entity:
|
||||
# load development environment variables
|
||||
# sea-orm-cli will also load .env file by default
|
||||
cd public/migration && \
|
||||
sea-orm-cli generate entity \
|
||||
-o ../database/src/generated/entities \
|
||||
--with-serde both \
|
||||
--date-time-crate chrono
|
||||
|
||||
# delegate to cli
|
||||
just cli db:migrate_and_generate --output-path ../../public/database/src/generated/entities
|
||||
|
||||
Reference in New Issue
Block a user