-
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.
generate new entities using seaORM CLI
- Loading branch information
1 parent
4083400
commit 328ca94
Showing
9 changed files
with
291 additions
and
7 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
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,40 @@ | ||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3 | ||
|
||
use sea_orm::entity::prelude::*; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] | ||
#[sea_orm(schema_name = "refactor_platform", table_name = "actions")] | ||
pub struct Model { | ||
#[sea_orm(primary_key)] | ||
#[serde(skip_deserializing)] | ||
pub id: i32, | ||
#[sea_orm(unique)] | ||
pub external_id: Uuid, | ||
pub coaching_session_id: i32, | ||
pub due_by: Option<DateTimeWithTimeZone>, | ||
pub completed: Option<bool>, | ||
pub completed_at: Option<DateTimeWithTimeZone>, | ||
pub created_at: Option<DateTime>, | ||
pub updated_at: Option<DateTime>, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | ||
pub enum Relation { | ||
#[sea_orm( | ||
belongs_to = "super::coaching_sessions::Entity", | ||
from = "Column::CoachingSessionId", | ||
to = "super::coaching_sessions::Column::Id", | ||
on_update = "NoAction", | ||
on_delete = "NoAction" | ||
)] | ||
CoachingSessions, | ||
} | ||
|
||
impl Related<super::coaching_sessions::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::CoachingSessions.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,53 @@ | ||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3 | ||
|
||
use sea_orm::entity::prelude::*; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] | ||
#[sea_orm(schema_name = "refactor_platform", table_name = "agreements")] | ||
pub struct Model { | ||
#[sea_orm(primary_key)] | ||
#[serde(skip_deserializing)] | ||
pub id: i32, | ||
#[sea_orm(unique)] | ||
pub external_id: Uuid, | ||
pub coaching_session_id: i32, | ||
pub details: Option<String>, | ||
pub user_id: i32, | ||
pub created_at: Option<DateTimeWithTimeZone>, | ||
pub updated_at: Option<DateTimeWithTimeZone>, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | ||
pub enum Relation { | ||
#[sea_orm( | ||
belongs_to = "super::coaching_sessions::Entity", | ||
from = "Column::CoachingSessionId", | ||
to = "super::coaching_sessions::Column::Id", | ||
on_update = "NoAction", | ||
on_delete = "NoAction" | ||
)] | ||
CoachingSessions, | ||
#[sea_orm( | ||
belongs_to = "super::users::Entity", | ||
from = "Column::UserId", | ||
to = "super::users::Column::Id", | ||
on_update = "NoAction", | ||
on_delete = "NoAction" | ||
)] | ||
Users, | ||
} | ||
|
||
impl Related<super::coaching_sessions::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::CoachingSessions.def() | ||
} | ||
} | ||
|
||
impl Related<super::users::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::Users.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,71 @@ | ||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3 | ||
|
||
use sea_orm::entity::prelude::*; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] | ||
#[sea_orm(schema_name = "refactor_platform", table_name = "coaching_sessions")] | ||
pub struct Model { | ||
#[sea_orm(primary_key)] | ||
#[serde(skip_deserializing)] | ||
pub id: i32, | ||
#[sea_orm(unique)] | ||
pub external_id: Uuid, | ||
pub coaching_relationship_id: i32, | ||
pub date: Option<DateTime>, | ||
pub timezone: Option<String>, | ||
pub created_at: Option<DateTimeWithTimeZone>, | ||
pub updated_at: Option<DateTimeWithTimeZone>, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | ||
pub enum Relation { | ||
#[sea_orm(has_many = "super::actions::Entity")] | ||
Actions, | ||
#[sea_orm(has_many = "super::agreements::Entity")] | ||
Agreements, | ||
#[sea_orm( | ||
belongs_to = "super::coaching_relationships::Entity", | ||
from = "Column::CoachingRelationshipId", | ||
to = "super::coaching_relationships::Column::Id", | ||
on_update = "NoAction", | ||
on_delete = "NoAction" | ||
)] | ||
CoachingRelationships, | ||
#[sea_orm(has_many = "super::notes::Entity")] | ||
Notes, | ||
#[sea_orm(has_many = "super::overarching_goals::Entity")] | ||
OverarchingGoals, | ||
} | ||
|
||
impl Related<super::actions::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::Actions.def() | ||
} | ||
} | ||
|
||
impl Related<super::agreements::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::Agreements.def() | ||
} | ||
} | ||
|
||
impl Related<super::coaching_relationships::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::CoachingRelationships.def() | ||
} | ||
} | ||
|
||
impl Related<super::notes::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::Notes.def() | ||
} | ||
} | ||
|
||
impl Related<super::overarching_goals::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::OverarchingGoals.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
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,53 @@ | ||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3 | ||
|
||
use sea_orm::entity::prelude::*; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] | ||
#[sea_orm(schema_name = "refactor_platform", table_name = "notes")] | ||
pub struct Model { | ||
#[sea_orm(primary_key)] | ||
#[serde(skip_deserializing)] | ||
pub id: i32, | ||
#[sea_orm(unique)] | ||
pub external_id: Uuid, | ||
pub coaching_session_id: i32, | ||
pub body: Option<String>, | ||
pub user_id: i32, | ||
pub created_at: Option<DateTimeWithTimeZone>, | ||
pub updated_at: Option<DateTimeWithTimeZone>, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | ||
pub enum Relation { | ||
#[sea_orm( | ||
belongs_to = "super::coaching_sessions::Entity", | ||
from = "Column::CoachingSessionId", | ||
to = "super::coaching_sessions::Column::Id", | ||
on_update = "NoAction", | ||
on_delete = "NoAction" | ||
)] | ||
CoachingSessions, | ||
#[sea_orm( | ||
belongs_to = "super::users::Entity", | ||
from = "Column::UserId", | ||
to = "super::users::Column::Id", | ||
on_update = "NoAction", | ||
on_delete = "NoAction" | ||
)] | ||
Users, | ||
} | ||
|
||
impl Related<super::coaching_sessions::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::CoachingSessions.def() | ||
} | ||
} | ||
|
||
impl Related<super::users::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::Users.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,40 @@ | ||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3 | ||
|
||
use sea_orm::entity::prelude::*; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] | ||
#[sea_orm(schema_name = "refactor_platform", table_name = "overarching_goals")] | ||
pub struct Model { | ||
#[sea_orm(primary_key)] | ||
#[serde(skip_deserializing)] | ||
pub id: i32, | ||
#[sea_orm(unique)] | ||
pub external_id: Uuid, | ||
pub coaching_session_id: Option<i32>, | ||
pub title: Option<String>, | ||
pub details: Option<String>, | ||
pub completed_at: Option<DateTimeWithTimeZone>, | ||
pub created_at: Option<DateTimeWithTimeZone>, | ||
pub updated_at: Option<DateTimeWithTimeZone>, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | ||
pub enum Relation { | ||
#[sea_orm( | ||
belongs_to = "super::coaching_sessions::Entity", | ||
from = "Column::CoachingSessionId", | ||
to = "super::coaching_sessions::Column::Id", | ||
on_update = "NoAction", | ||
on_delete = "NoAction" | ||
)] | ||
CoachingSessions, | ||
} | ||
|
||
impl Related<super::coaching_sessions::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::CoachingSessions.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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3 | ||
|
||
pub use super::coaching_relationships::Entity as CoachingRelationships; | ||
pub use super::organizations::Entity as Organizations; | ||
pub use super::users::Entity as Users; | ||
pub use super::actions::Entity as Actions; | ||
pub use super::agreements::Entity as Agreements; | ||
pub use super::coaching_sessions::Entity as CoachingSessions; | ||
pub use super::notes::Entity as Notes; | ||
pub use super::overarching_goals::Entity as OverarchingGoals; | ||
pub use super::seaql_migrations::Entity as SeaqlMigrations; |
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,18 @@ | ||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3 | ||
|
||
use sea_orm::entity::prelude::*; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] | ||
#[sea_orm(schema_name = "refactor_platform", table_name = "seaql_migrations")] | ||
pub struct Model { | ||
#[sea_orm(primary_key, auto_increment = false)] | ||
#[serde(skip_deserializing)] | ||
pub version: String, | ||
pub applied_at: i64, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | ||
pub enum Relation {} | ||
|
||
impl ActiveModelBehavior for ActiveModel {} |