Open hhstore opened 2 years ago
关于作者:
raw sql
模式.自动生成 db model(entity) 数据结构.
# Generate entity files of database `bakery` to `entity/src`
$ sea-orm-cli generate entity \
-u sql://sea:sea@localhost/bakery \
-o entity/src
自带 migration 工具.
# Setup the migration directory in `./migration`
$ sea-orm-cli migrate init
Initializing migration directory...
Creating file `./migration/src/lib.rs`
Creating file `./migration/src/m20220101_000001_create_table.rs`
Creating file `./migration/src/main.rs`
Creating file `./migration/Cargo.toml`
Creating file `./migration/README.md`
Done!
# If you want to setup the migration directory in else where
$ sea-orm-cli migrate init -d ./other/migration/dir
$ sea-orm-cli migrate COMMAND
$ sea-orm-cli migrate COMMAND -d ./other/migration/dir
1
1
1
1
related: