-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
67b5ae8
commit d8c66d2
Showing
14 changed files
with
743 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0 | ||
use sea_orm::entity::prelude::*; | ||
|
||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] | ||
#[sea_orm(table_name = "cascades_group")] | ||
pub struct Model { | ||
#[sea_orm(primary_key)] | ||
pub id: i32, | ||
pub winner: Option<i32>, | ||
pub cost: Option<i64>, | ||
pub is_optimized: bool, | ||
pub parent_id: Option<i32>, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | ||
pub enum Relation { | ||
#[sea_orm( | ||
belongs_to = "Entity", | ||
from = "Column::ParentId", | ||
to = "Column::Id", | ||
on_update = "Cascade", | ||
on_delete = "SetNull" | ||
)] | ||
SelfRef, | ||
#[sea_orm(has_many = "super::logical_children::Entity")] | ||
LogicalChildren, | ||
#[sea_orm(has_many = "super::logical_expression::Entity")] | ||
LogicalExpression, | ||
#[sea_orm(has_many = "super::physical_children::Entity")] | ||
PhysicalChildren, | ||
#[sea_orm( | ||
belongs_to = "super::physical_expression::Entity", | ||
from = "Column::Winner", | ||
to = "super::physical_expression::Column::Id", | ||
on_update = "Cascade", | ||
on_delete = "SetNull" | ||
)] | ||
PhysicalExpression, | ||
} | ||
|
||
impl Related<super::logical_children::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::LogicalChildren.def() | ||
} | ||
} | ||
|
||
impl Related<super::physical_children::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::PhysicalChildren.def() | ||
} | ||
} | ||
|
||
impl Related<super::logical_expression::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
super::logical_children::Relation::LogicalExpression.def() | ||
} | ||
fn via() -> Option<RelationDef> { | ||
Some(super::logical_children::Relation::CascadesGroup.def().rev()) | ||
} | ||
} | ||
|
||
impl Related<super::physical_expression::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
super::physical_children::Relation::PhysicalExpression.def() | ||
} | ||
fn via() -> Option<RelationDef> { | ||
Some( | ||
super::physical_children::Relation::CascadesGroup | ||
.def() | ||
.rev(), | ||
) | ||
} | ||
} | ||
|
||
impl ActiveModelBehavior for ActiveModel {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0 | ||
use sea_orm::entity::prelude::*; | ||
|
||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] | ||
#[sea_orm(table_name = "logical_children")] | ||
pub struct Model { | ||
#[sea_orm(primary_key, auto_increment = false)] | ||
pub logical_expression_id: i32, | ||
#[sea_orm(primary_key, auto_increment = false)] | ||
pub group_id: i32, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | ||
pub enum Relation { | ||
#[sea_orm( | ||
belongs_to = "super::cascades_group::Entity", | ||
from = "Column::GroupId", | ||
to = "super::cascades_group::Column::Id", | ||
on_update = "Cascade", | ||
on_delete = "Cascade" | ||
)] | ||
CascadesGroup, | ||
#[sea_orm( | ||
belongs_to = "super::logical_expression::Entity", | ||
from = "Column::GroupId", | ||
to = "super::logical_expression::Column::Id", | ||
on_update = "Cascade", | ||
on_delete = "Cascade" | ||
)] | ||
LogicalExpression, | ||
} | ||
|
||
impl Related<super::cascades_group::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::CascadesGroup.def() | ||
} | ||
} | ||
|
||
impl Related<super::logical_expression::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::LogicalExpression.def() | ||
} | ||
} | ||
|
||
impl ActiveModelBehavior for ActiveModel {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0 | ||
use sea_orm::entity::prelude::*; | ||
|
||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] | ||
#[sea_orm(table_name = "logical_expression")] | ||
pub struct Model { | ||
#[sea_orm(primary_key)] | ||
pub id: i32, | ||
pub group_id: i32, | ||
pub fingerprint: i64, | ||
pub kind: i16, | ||
pub data: Json, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | ||
pub enum Relation { | ||
#[sea_orm( | ||
belongs_to = "super::cascades_group::Entity", | ||
from = "Column::GroupId", | ||
to = "super::cascades_group::Column::Id", | ||
on_update = "Cascade", | ||
on_delete = "Cascade" | ||
)] | ||
CascadesGroup, | ||
#[sea_orm(has_many = "super::logical_children::Entity")] | ||
LogicalChildren, | ||
} | ||
|
||
impl Related<super::logical_children::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::LogicalChildren.def() | ||
} | ||
} | ||
|
||
impl Related<super::cascades_group::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
super::logical_children::Relation::CascadesGroup.def() | ||
} | ||
fn via() -> Option<RelationDef> { | ||
Some( | ||
super::logical_children::Relation::LogicalExpression | ||
.def() | ||
.rev(), | ||
) | ||
} | ||
} | ||
|
||
impl ActiveModelBehavior for ActiveModel {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0 | ||
pub mod prelude; | ||
|
||
pub mod cascades_group; | ||
pub mod logical_children; | ||
pub mod logical_expression; | ||
pub mod physical_children; | ||
pub mod physical_expression; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0 | ||
use sea_orm::entity::prelude::*; | ||
|
||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] | ||
#[sea_orm(table_name = "physical_children")] | ||
pub struct Model { | ||
#[sea_orm(primary_key, auto_increment = false)] | ||
pub physical_expression_id: i32, | ||
#[sea_orm(primary_key, auto_increment = false)] | ||
pub group_id: i32, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | ||
pub enum Relation { | ||
#[sea_orm( | ||
belongs_to = "super::cascades_group::Entity", | ||
from = "Column::GroupId", | ||
to = "super::cascades_group::Column::Id", | ||
on_update = "Cascade", | ||
on_delete = "Cascade" | ||
)] | ||
CascadesGroup, | ||
#[sea_orm( | ||
belongs_to = "super::physical_expression::Entity", | ||
from = "Column::PhysicalExpressionId", | ||
to = "super::physical_expression::Column::Id", | ||
on_update = "Cascade", | ||
on_delete = "Cascade" | ||
)] | ||
PhysicalExpression, | ||
} | ||
|
||
impl Related<super::cascades_group::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::CascadesGroup.def() | ||
} | ||
} | ||
|
||
impl Related<super::physical_expression::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::PhysicalExpression.def() | ||
} | ||
} | ||
|
||
impl ActiveModelBehavior for ActiveModel {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0 | ||
use sea_orm::entity::prelude::*; | ||
|
||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] | ||
#[sea_orm(table_name = "physical_expression")] | ||
pub struct Model { | ||
#[sea_orm(primary_key)] | ||
pub id: i32, | ||
pub group_id: i32, | ||
pub fingerprint: i64, | ||
pub kind: i16, | ||
pub data: Json, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | ||
pub enum Relation { | ||
#[sea_orm( | ||
belongs_to = "super::cascades_group::Entity", | ||
from = "Column::GroupId", | ||
to = "super::cascades_group::Column::Id", | ||
on_update = "Cascade", | ||
on_delete = "Cascade" | ||
)] | ||
CascadesGroup, | ||
#[sea_orm(has_many = "super::physical_children::Entity")] | ||
PhysicalChildren, | ||
} | ||
|
||
impl Related<super::physical_children::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::PhysicalChildren.def() | ||
} | ||
} | ||
|
||
impl Related<super::cascades_group::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
super::physical_children::Relation::CascadesGroup.def() | ||
} | ||
fn via() -> Option<RelationDef> { | ||
Some( | ||
super::physical_children::Relation::PhysicalExpression | ||
.def() | ||
.rev(), | ||
) | ||
} | ||
} | ||
|
||
impl ActiveModelBehavior for ActiveModel {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0 | ||
#![allow(unused_imports)] | ||
|
||
pub use super::cascades_group::Entity as CascadesGroup; | ||
pub use super::logical_children::Entity as LogicalChildren; | ||
pub use super::logical_expression::Entity as LogicalExpression; | ||
pub use super::physical_children::Entity as PhysicalChildren; | ||
pub use super::physical_expression::Entity as PhysicalExpression; |
Oops, something went wrong.