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:
toolchain: stable
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 test --manifest-path ${{ matrix.path }}
- if: ${{ contains(matrix.path, 'core/Cargo.toml') }}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -10,7 +10,11 @@ pub struct Model {
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
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,
}

View File

@ -11,9 +11,17 @@ pub struct Model {
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
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,
#[sea_orm(belongs_to = "Entity", from = "Column::SelfIdd", to = "Column::Id")]
#[sea_orm(
belongs_to = "Entity",
from = "Column::SelfIdd",
to = "Column::Id",
)]
SelfRef1,
}