Skip to content

Commit

Permalink
Revert Unintended Formatting Changes SeaQL#2160
Browse files Browse the repository at this point in the history
  • Loading branch information
anshap1719 committed Apr 26, 2024
1 parent 4bec02d commit a349af0
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use sea_orm::entity::prelude::*;
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub user_id: Option<i32>,
pub user_id: Option<i32> ,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
Expand All @@ -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")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ pub enum Relation {
from = "Column::BillId",
to = "super::bills::Column::Id",
on_update = "Cascade",
on_delete = "Cascade"
on_delete = "Cascade",
)]
Bills,
#[sea_orm(
belongs_to = "super::users::Entity",
from = "Column::UserId",
to = "super::users::Column::Id",
on_update = "Cascade",
on_delete = "Cascade"
on_delete = "Cascade",
)]
Users,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ pub enum Relation {
from = "Column::BillId",
to = "super::bills::Column::Id",
on_update = "Cascade",
on_delete = "Cascade"
on_delete = "Cascade",
)]
Bills,
#[sea_orm(
belongs_to = "super::users::Entity",
from = "Column::UserId",
to = "super::users::Column::Id",
on_update = "Cascade",
on_delete = "Cascade"
on_delete = "Cascade",
)]
Users,
}
Expand Down
4 changes: 2 additions & 2 deletions sea-orm-codegen/src/tests_cfg/many_to_many/bills.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use sea_orm::entity::prelude::*;
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub user_id: Option<i32>,
pub user_id: Option<i32> ,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
Expand All @@ -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")]
Expand Down
4 changes: 2 additions & 2 deletions sea-orm-codegen/src/tests_cfg/many_to_many/users_votes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ pub enum Relation {
from = "Column::BillId",
to = "super::bills::Column::Id",
on_update = "Cascade",
on_delete = "Cascade"
on_delete = "Cascade",
)]
Bills,
#[sea_orm(
belongs_to = "super::users::Entity",
from = "Column::UserId",
to = "super::users::Column::Id",
on_update = "Cascade",
on_delete = "Cascade"
on_delete = "Cascade",
)]
Users,
}
Expand Down
4 changes: 2 additions & 2 deletions sea-orm-codegen/src/tests_cfg/many_to_many_multiple/bills.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use sea_orm::entity::prelude::*;
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub user_id: Option<i32>,
pub user_id: Option<i32> ,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
Expand All @@ -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,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ pub struct Model {
pub user_id: i32,
#[sea_orm(primary_key, auto_increment = false)]
pub bill_id: i32,
pub user_idd: Option<i32>,
pub bill_idd: Option<i32>,
pub user_idd: Option<i32> ,
pub bill_idd: Option<i32> ,
pub vote: bool,
}

Expand All @@ -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,
}
Expand Down
8 changes: 6 additions & 2 deletions sea-orm-codegen/src/tests_cfg/self_referencing/bills.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ use sea_orm::entity::prelude::*;
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub self_id: Option<i32>,
pub self_id: Option<i32> ,
}

#[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,
}

Expand Down
16 changes: 12 additions & 4 deletions sea-orm-codegen/src/tests_cfg/self_referencing/users.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,23 @@ use sea_orm::entity::prelude::*;
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub self_id: Option<i32>,
pub self_idd: Option<i32>,
pub self_id: Option<i32> ,
pub self_idd: Option<i32> ,
}

#[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,
}

Expand Down
4 changes: 2 additions & 2 deletions sea-orm-codegen/tests/compact/vendor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ pub struct Model {
#[sea_orm(column_name = "_name_")]
pub name: String,
#[sea_orm(column_name = "fruitId")]
pub fruit_id: Option<i32>,
pub fruit_id: Option<i32> ,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::fruit::Entity",
from = "Column::FruitId",
to = "super::fruit::Column::Id"
to = "super::fruit::Column::Id",
)]
Fruit,
}
Expand Down
4 changes: 2 additions & 2 deletions sea-orm-codegen/tests/compact_with_schema_name/vendor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ pub struct Model {
#[sea_orm(column_name = "_name_")]
pub name: String,
#[sea_orm(column_name = "fruitId")]
pub fruit_id: Option<i32>,
pub fruit_id: Option<i32> ,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::fruit::Entity",
from = "Column::FruitId",
to = "super::fruit::Column::Id"
to = "super::fruit::Column::Id",
)]
Fruit,
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! SeaORM Entity. Generated by sea-orm-codegen 0.1.0

use sea_orm::entity::prelude::*;
use sea_orm::entity::prelude:: * ;
use serde::Serialize;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize)]
Expand All @@ -10,7 +10,7 @@ pub struct Model {
pub id: i32,
#[sea_orm(column_name = "_name", column_type = "Text", nullable)]
#[serde(skip)]
pub name: Option<String>,
pub name: Option<String> ,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
Expand Down
2 changes: 1 addition & 1 deletion sea-orm-codegen/tests/expanded/vendor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ impl EntityName for Entity {
pub struct Model {
pub id: i32,
pub name: String,
pub fruit_id: Option<i32>,
pub fruit_id: Option<i32> ,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
Expand Down
4 changes: 2 additions & 2 deletions sea-orm-codegen/tests/expanded_with_schema_name/vendor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use sea_orm::entity::prelude::*;
pub struct Entity;

impl EntityName for Entity {
fn schema_name(&self) -> Option<&str> {
fn schema_name(&self) -> Option< &str > {
Some("schema_name")
}

Expand All @@ -19,7 +19,7 @@ impl EntityName for Entity {
pub struct Model {
pub id: i32,
pub name: String,
pub fruit_id: Option<i32>,
pub fruit_id: Option<i32> ,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! SeaORM Entity. Generated by sea-orm-codegen 0.1.0

use sea_orm::entity::prelude::*;
use sea_orm::entity::prelude:: * ;
use serde::Serialize;

#[derive(Copy, Clone, Default, Debug, DeriveEntity)]
Expand All @@ -16,7 +16,7 @@ impl EntityName for Entity {
pub struct Model {
pub id: i32,
#[serde(skip)]
pub name: Option<String>,
pub name: Option<String> ,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
Expand Down

0 comments on commit a349af0

Please sign in to comment.