66 Commits

Author SHA1 Message Date
Chris Tsang
e1f19ed801 sea-orm-cli 0.8.0 2022-05-10 00:04:48 +08:00
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
Chris Tsang
2794410a08 Update sea-schema 2022-05-09 21:02:53 +08:00
Chris Tsang
07c8af2b3a Use sea-schema's SchemaProbe 2022-05-09 17:04:12 +08:00
Chris Tsang
c466e46ae0 Fix tests 2022-05-09 14:44:12 +08:00
Chris Tsang
730b52088f Add tests 2022-05-09 12:31:12 +08:00
Chris Tsang
75d5c0f5ea Restructure sea-orm-cli & sea-orm-migration 2022-05-09 12:30:58 +08:00
Billy Chan
498c0154ca Restructure SeaORM migration
Bump codegen's sea-query version [cli]

Update CLI subcommand method

Move migration utility into sea-orm-migration
2022-05-09 12:30:55 +08:00
Chris Tsang
2cf0deeb2c sea-orm-cli 0.7.2 2022-03-27 20:51:10 +08:00
Chris Tsang
86fa15563d sea-orm-cli 0.7.1 2022-03-27 00:07:33 +08:00
Chris Tsang
a3c7381055 Update sea-schema 2022-03-27 00:06:48 +08:00
Chris Tsang
1e8c725eca sea-orm-cli 0.7.0 2022-03-26 18:30:18 +08:00
Alex
fe1877a49d
sea as an alternative bin name to sea-orm-cli (#558)
* Simplify bin name from  sea-orm-cli to sea

* -S

* fixed test
2022-03-26 18:06:14 +08:00
Billy Chan
73701fef9a
Codegen Unsigned Integer - 2 (#397)
* feat: codegen unsigned integer

* feat: apply alias on `ColumnRef::SchemaTableColumn`

* Update SQLite test cases, quote identifier with double quotes

* Bump sea-query version to 0.22

* Add dummy line

* Tests [cli] and [issues]

* update sea-schema

Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
2022-03-14 12:40:02 +08:00
Chris Tsang
54b1f4a226 Use caret requirements 2022-02-07 21:32:35 +08:00
Chris Tsang
f8ab11d36a Use sea-schema 0.5.1 2022-02-07 21:27:22 +08:00
Billy Chan
cd98137ad0 Update examples sea-orm version
Update example sea-schema version

Update [cli] sea-schema version
2022-02-07 20:55:15 +08:00
Chris Tsang
0e2ea839c2 sea-orm-cli 0.6.0 2022-02-07 00:10:52 +08:00
Chris Tsang
3cde517d2a Fix sea-schema dependency 2022-02-05 20:58:22 +08:00
Billy Chan
8eb095385d Migration (#335)
* Refactor `ConnectionTrait`

* Refactoring

* Build index & foreign key statements

* Fix imports

* Fixup

* Rocket example with migration

* async-std compatible with the tokio 1.0 runtime

* Use reexported dependency

* Compile without selecting any db backend

* Updating sea-orm-cli dep

* sea-orm-cli migrate commands

* cargo fmt

* Test [cli]

* Refactoring

* Clap app name should be "sea-orm-cli"

* Correctly capture MIGRATION_DIR

* Rename README

* Add `sea-orm-cli migrate init` command

* Update README

* Try restructured sea-query dependency (SeaQL/sea-schema#41)

* Set `DATABASE_URL` environment variable
2022-02-05 20:34:54 +08:00
Chris Tsang
82bad4a376 0.5.0 2022-01-01 16:05:36 +08:00
Chris Tsang
be5badf578 sea-orm-cli 0.5.0-rc.1 2021-12-26 02:28:28 +08:00
Chris Tsang
cf685fed26 Bump sea-schema 2021-12-25 18:32:20 +08:00
Billy Chan
9036d27da7
Codegen SQLite (#386)
* Codegen SQLite

* Remove debugging

* Fixup

* Add SQLite "sakila.db" demo [issues]
2021-12-25 11:31:47 +08:00
Billy Chan
2d5aa2a61b
Log with tracing-subscriber (#399)
* chore: log examples with tracing-subscriber

* chore: log [issues] with tracing-subscriber

* chore: log [cli] with tracing-subscriber

* feat: tracing will emit log if tracing-subscriber is not setup
2021-12-24 23:59:37 +08:00
Billy Chan
f5f6a6774f
Codegen ActiveEnum & Create Enum From ActiveEnum (#348) 2021-12-15 00:52:50 +08:00
Chris Tsang
0ea4f4e940 sea-orm-cli 0.4.2 2021-12-12 22:46:18 +08:00
Chris Tsang
4dcc44dfb8 sea-orm-cli 0.4.1 2021-12-05 00:13:50 +08:00
Chris Tsang
6330b54bc7 sea-orm-cli 0.4.0 2021-11-19 23:04:32 +08:00
Carter Snook
058f6d5d2b
chore: update to Rust Edition 2021 (#273) 2021-10-26 17:27:53 +08:00
Chris Tsang
ada845de98 sea-orm-cli 0.3.1 2021-10-23 16:01:09 +08:00
Chris Tsang
f506ad6581 Tweak 2021-10-19 18:51:56 +08:00
Forest Anderson
8d06aea00b Added tests 2021-10-19 01:11:54 -04:00
Forest Anderson
bcc5b5066a Changed manual url parsing to use Url crate 2021-10-16 23:19:48 -04:00
Chris Tsang
337d7c35e9 sea-orm-cli 0.3.0 2021-10-16 01:42:05 +08:00
Chris Tsang
0eee2206ba sea-orm-cli 0.2.6 2021-10-09 23:15:03 +08:00
Chris Tsang
e229651eae sea-orm-cli 0.2.5 2021-10-06 18:44:24 +08:00
Chris Tsang
7cbe5b4b9f sea-orm-cli 0.2.4 2021-09-26 16:44:55 +08:00
Chris Tsang
0c859c3e87 sea-orm-cli 0.2.4 prerelease 2021-09-24 13:01:26 +08:00
Chris Tsang
8a0c5272c9 Bump sea-schema version 2021-09-24 12:45:58 +08:00
Chris Tsang
3f554b0a09 sea-orm-cli 0.2.3 2021-09-22 17:38:06 +08:00
Chris Tsang
1977d69202 sea-orm-cli 0.2.2 2021-09-17 23:40:53 +08:00
Chris Tsang
e36be13611 Bump dependency version 2021-09-17 23:27:14 +08:00
Billy Chan
ffb0f1f07d
Codegen supports ColumnType::TimestampWithTimeZone 2021-09-17 21:57:16 +08:00
Chris Tsang
51a690ba99
Update Cargo.toml 2021-09-17 12:26:31 +08:00
Chris Tsang
2b36ab0ae0
Update Cargo.toml 2021-09-17 12:23:06 +08:00
Billy Chan
962d895249
Add CLI verbose option 2021-09-16 10:14:01 +08:00
Chris Tsang
dc10caac4c Fix sea-schema dependency 2021-09-15 12:57:50 +08:00
Billy Chan
f801590b9b
Remove unused sea-orm dep 2021-09-10 23:21:37 +08:00
Billy Chan
a6f117a908
sea-orm-cli with --expanded-format & --compact-format flags 2021-09-10 23:08:30 +08:00