This reverts commit 27af2c9c056be580d22d3a32fd0f766cf4443e3c.
This commit is contained in:
Chris Tsang 2023-06-22 17:05:22 +08:00
parent 27af2c9c05
commit c4f1a3c4af
10 changed files with 37 additions and 25 deletions

View File

@ -251,7 +251,7 @@ jobs:
with: with:
toolchain: stable toolchain: stable
components: rustfmt components: rustfmt
- run: cargo fmt --manifest-path ${{ matrix.path }} -- --check - run: cargo fmt --manifest-path ${{ matrix.path }} --all --check
- run: cargo build --manifest-path ${{ matrix.path }} - run: cargo build --manifest-path ${{ matrix.path }}
- run: cargo test --manifest-path ${{ matrix.path }} - run: cargo test --manifest-path ${{ matrix.path }}
- if: ${{ contains(matrix.path, 'core/Cargo.toml') }} - if: ${{ contains(matrix.path, 'core/Cargo.toml') }}

View File

@ -15,7 +15,7 @@ pub enum Relation {
from = "Column::UserId", from = "Column::UserId",
to = "super::users::Column::Id", to = "super::users::Column::Id",
on_update = "NoAction", on_update = "NoAction",
on_delete = "NoAction" on_delete = "NoAction",
)] )]
Users, Users,
#[sea_orm(has_many = "super::users_saved_bills::Entity")] #[sea_orm(has_many = "super::users_saved_bills::Entity")]

View File

@ -16,7 +16,7 @@ pub enum Relation {
from = "Column::BillId", from = "Column::BillId",
to = "super::bills::Column::Id", to = "super::bills::Column::Id",
on_update = "Cascade", on_update = "Cascade",
on_delete = "Cascade" on_delete = "Cascade",
)] )]
Bills, Bills,
#[sea_orm( #[sea_orm(
@ -24,7 +24,7 @@ pub enum Relation {
from = "Column::UserId", from = "Column::UserId",
to = "super::users::Column::Id", to = "super::users::Column::Id",
on_update = "Cascade", on_update = "Cascade",
on_delete = "Cascade" on_delete = "Cascade",
)] )]
Users, Users,
} }

View File

@ -17,7 +17,7 @@ pub enum Relation {
from = "Column::BillId", from = "Column::BillId",
to = "super::bills::Column::Id", to = "super::bills::Column::Id",
on_update = "Cascade", on_update = "Cascade",
on_delete = "Cascade" on_delete = "Cascade",
)] )]
Bills, Bills,
#[sea_orm( #[sea_orm(
@ -25,7 +25,7 @@ pub enum Relation {
from = "Column::UserId", from = "Column::UserId",
to = "super::users::Column::Id", to = "super::users::Column::Id",
on_update = "Cascade", on_update = "Cascade",
on_delete = "Cascade" on_delete = "Cascade",
)] )]
Users, Users,
} }

View File

@ -15,7 +15,7 @@ pub enum Relation {
from = "Column::UserId", from = "Column::UserId",
to = "super::users::Column::Id", to = "super::users::Column::Id",
on_update = "NoAction", on_update = "NoAction",
on_delete = "NoAction" on_delete = "NoAction",
)] )]
Users, Users,
#[sea_orm(has_many = "super::users_votes::Entity")] #[sea_orm(has_many = "super::users_votes::Entity")]

View File

@ -17,7 +17,7 @@ pub enum Relation {
from = "Column::BillId", from = "Column::BillId",
to = "super::bills::Column::Id", to = "super::bills::Column::Id",
on_update = "Cascade", on_update = "Cascade",
on_delete = "Cascade" on_delete = "Cascade",
)] )]
Bills, Bills,
#[sea_orm( #[sea_orm(
@ -25,7 +25,7 @@ pub enum Relation {
from = "Column::UserId", from = "Column::UserId",
to = "super::users::Column::Id", to = "super::users::Column::Id",
on_update = "Cascade", on_update = "Cascade",
on_delete = "Cascade" on_delete = "Cascade",
)] )]
Users, Users,
} }

View File

@ -15,7 +15,7 @@ pub enum Relation {
from = "Column::UserId", from = "Column::UserId",
to = "super::users::Column::Id", to = "super::users::Column::Id",
on_update = "NoAction", on_update = "NoAction",
on_delete = "NoAction" on_delete = "NoAction",
)] )]
Users, Users,
} }

View File

@ -17,25 +17,25 @@ pub enum Relation {
#[sea_orm( #[sea_orm(
belongs_to = "super::bills::Entity", belongs_to = "super::bills::Entity",
from = "Column::BillIdd", from = "Column::BillIdd",
to = "super::bills::Column::Id" to = "super::bills::Column::Id",
)] )]
Bills2, Bills2,
#[sea_orm( #[sea_orm(
belongs_to = "super::bills::Entity", belongs_to = "super::bills::Entity",
from = "Column::BillId", from = "Column::BillId",
to = "super::bills::Column::Id" to = "super::bills::Column::Id",
)] )]
Bills1, Bills1,
#[sea_orm( #[sea_orm(
belongs_to = "super::users::Entity", belongs_to = "super::users::Entity",
from = "Column::UserIdd", from = "Column::UserIdd",
to = "super::users::Column::Id" to = "super::users::Column::Id",
)] )]
Users2, Users2,
#[sea_orm( #[sea_orm(
belongs_to = "super::users::Entity", belongs_to = "super::users::Entity",
from = "Column::UserId", from = "Column::UserId",
to = "super::users::Column::Id" to = "super::users::Column::Id",
)] )]
Users1, Users1,
} }

View File

@ -10,7 +10,11 @@ pub struct Model {
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation { pub enum Relation {
#[sea_orm(belongs_to = "Entity", from = "Column::SelfId", to = "Column::Id")] #[sea_orm(
belongs_to = "Entity",
from = "Column::SelfId",
to = "Column::Id",
)]
SelfRef, SelfRef,
} }

View File

@ -11,9 +11,17 @@ pub struct Model {
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation { pub enum Relation {
#[sea_orm(belongs_to = "Entity", from = "Column::SelfId", to = "Column::Id")] #[sea_orm(
belongs_to = "Entity",
from = "Column::SelfId",
to = "Column::Id",
)]
SelfRef2, SelfRef2,
#[sea_orm(belongs_to = "Entity", from = "Column::SelfIdd", to = "Column::Id")] #[sea_orm(
belongs_to = "Entity",
from = "Column::SelfIdd",
to = "Column::Id",
)]
SelfRef1, SelfRef1,
} }