Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration #335

Merged
merged 21 commits into from
Feb 5, 2022
Merged

Migration #335

merged 21 commits into from
Feb 5, 2022

Conversation

billy1624
Copy link
Member

@billy1624 billy1624 commented Nov 26, 2021

@billy1624 billy1624 self-assigned this Nov 26, 2021
@tyt2y3 tyt2y3 force-pushed the master branch 7 times, most recently from bc75b4b to e7d7962 Compare December 25, 2021 17:00
@billy1624 billy1624 marked this pull request as ready for review January 20, 2022 09:56
@billy1624 billy1624 requested a review from tyt2y3 January 28, 2022 12:44
@@ -345,10 +349,17 @@ impl<'a> ConnectionTrait<'a> for DatabaseTransaction {
}
#[cfg(feature = "mock")]
InnerConnection::Mock(conn) => return conn.query_all(stmt),
#[allow(unreachable_patterns)]
_ => unreachable!(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it needed here?

Copy link
Member Author

@billy1624 billy1624 Jan 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sea-schema depends on sea-orm because it needs the symbol to compile. It's up to the end-user to decide which backend they want to enable. So, it's defined as below, but this won't compile because it requires at least one backend / mock feature to be selected.

sea-orm = { git = "https://github.com/SeaQL/sea-orm.git", branch = "migration", default-features = false, features = ["macros"], optional = true }

https://github.com/SeaQL/sea-schema/blob/3309d13819ae8b2d58dcf4ebbd4cb1936a7f8f15/Cargo.toml#L40

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay if we actually figured a way of building sea-orm without any backend, it's good! It could have resolved #438 (comment) as a side effect?

@tyt2y3 tyt2y3 merged commit 8d0364d into master Feb 5, 2022
@tyt2y3 tyt2y3 deleted the migration branch February 5, 2022 12:32
tyt2y3 pushed a commit that referenced this pull request Feb 5, 2022
* 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
tyt2y3 added a commit that referenced this pull request Mar 6, 2022
* Add Poem example

* Name conflict of foreign key constraints when two entities have more than one foreign keys (#417)

* fix: name conflict of foreign key constraints when two entities have more than one fk

* test: update test case's foreign keys

* feat: override default name of foreign key constraint

* Add `max_lifetime` connection option

* Remove `r#` prefix from column name when field has a raw identifier

* Fix FromQueryResult when Result is redefined

Macros should only ever use absolute import paths.
Shorthands can clash (as they have in my case).

* Support the use of chrono::DateTime<Utc> in sea-orm

Add documentation for this

Temporarily use a fork to include new Sea-query code

Add tests for DateTimeUtc

Solve Github actions error by add the code to create a table

Assertion accuracy tests

Rectify incorrect format

* Refactoring

`ColumnDef` with default value

Cargo fmt

Update docs

Fixup

Support `DateTimeLocal`

Update docs

Codegen write db timestamp column as `DateTimeUtc` type

Update dependency

Merge branch 'sea-query/add-new-column-ref' into pr/429

feat: apply alias on `ColumnRef::SchemaTableColumn`

* Update sea-query dependency

* Fully quantity `std::result::Result` in proc_maros

* 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

* Fix sea-schema dependency

* Codegen `column_name` proc_macro attribute (#433)

* feat: codegen `column_name` proc_macro attribute

* test: codegen `column_name`

* Temporary fix

* Fix sea-orm dependency

* Insert Default - Inserting `ActiveModel` with all attributes `NotSet` (#432)

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

* build: update sea-query dependency

* feat: insert default

* Use sea-query 0.21

Co-authored-by: Billy Chan <[email protected]>

* Easy joins with MockDatabase #447 (#455)

* Easy joins with MockDatabase #447

* fix MR

* add unit test

* Add test cases

* Cargo fmt

Co-authored-by: Bastian Schubert <[email protected]>
Co-authored-by: Billy Chan <[email protected]>
Co-authored-by: Chris Tsang <[email protected]>

* cargo fmt

* Revert "Insert Default - Inserting `ActiveModel` with all attributes `NotSet` (#432)"

This reverts commit 33a87d7.

* Prepare release

* sea-orm-codegen 0.6.0

* sea-orm-cli 0.6.0

* sea-orm-macros 0.6.0

* 0.6.0

* Optimize GitHub actions

* Update examples sea-orm version

Update example sea-schema version

Update [cli] sea-schema version

* Fix [cli] cargo publish failed

* Update CHANGELOG

* Use sea-schema 0.5.1

* use sea_schema::migration::prelude

* Use caret requirements

* Fix build error

* Examples with migration (#509)

* Update examples sea-orm version

* Update example sea-schema version

* Update [cli] sea-schema version

* Fix [cli] cargo publish failed

* Update CHANGELOG

* Edit rocket example

* Poem example with migration

* Axum example with migration

* Refactoring

* Actix4 example with migration

* Actix example with migration

* Use sea_schema::migration::prelude

Co-authored-by: Sunli <[email protected]>
Co-authored-by: Billy Chan <[email protected]>
Co-authored-by: Billy Chan <[email protected]>
Co-authored-by: Szepesi Tibor <[email protected]>
Co-authored-by: Tom Hacohen <[email protected]>
Co-authored-by: Charles Chege <[email protected]>
Co-authored-by: Bastian <[email protected]>
Co-authored-by: Bastian Schubert <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Migration Supports
2 participants