diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b9618904..4affff66 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -316,7 +316,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - path: [86, 249, 262, 319, 324, 352, 356, 386] + path: [86, 249, 262, 319, 324, 352, 356] steps: - uses: actions/checkout@v2 diff --git a/issues/386/Cargo.toml b/issues/386/Cargo.toml deleted file mode 100644 index f3a975f1..00000000 --- a/issues/386/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[workspace] -# A separate workspace - -[package] -name = "sea-orm-issues-386" -version = "0.1.0" -edition = "2021" -publish = false - -[dependencies] -sea-orm = { path = "../../", features = [ "sqlx-mysql", "runtime-async-std-native-tls" ]} diff --git a/issues/386/src/compact/actor.rs b/issues/386/src/compact/actor.rs deleted file mode 100644 index ad7248d6..00000000 --- a/issues/386/src/compact/actor.rs +++ /dev/null @@ -1,27 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] -#[sea_orm(table_name = "actor")] -pub struct Model { - #[sea_orm(primary_key)] - pub actor_id: i32, - pub first_name: String, - pub last_name: String, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm(has_many = "super::film_actor::Entity")] - FilmActor, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::FilmActor.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/compact/address.rs b/issues/386/src/compact/address.rs deleted file mode 100644 index 04541e3c..00000000 --- a/issues/386/src/compact/address.rs +++ /dev/null @@ -1,61 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] -#[sea_orm(table_name = "address")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false)] - pub address_id: i32, - pub address: String, - pub address2: Option, - pub district: String, - pub city_id: i32, - pub postal_code: Option, - pub phone: String, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::city::Entity", - from = "Column::CityId", - to = "super::city::Column::CityId", - on_update = "Cascade", - on_delete = "NoAction" - )] - City, - #[sea_orm(has_many = "super::customer::Entity")] - Customer, - #[sea_orm(has_many = "super::staff::Entity")] - Staff, - #[sea_orm(has_many = "super::store::Entity")] - Store, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::City.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Customer.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Staff.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Store.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/compact/category.rs b/issues/386/src/compact/category.rs deleted file mode 100644 index a7ff20f3..00000000 --- a/issues/386/src/compact/category.rs +++ /dev/null @@ -1,30 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] -#[sea_orm(table_name = "category")] -pub struct Model { - #[sea_orm( - primary_key, - auto_increment = false, - column_type = "Custom(\"BLOB\".to_owned())" - )] - pub category_id: String, - pub name: String, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm(has_many = "super::film_category::Entity")] - FilmCategory, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::FilmCategory.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/compact/city.rs b/issues/386/src/compact/city.rs deleted file mode 100644 index 02d28b0d..00000000 --- a/issues/386/src/compact/city.rs +++ /dev/null @@ -1,42 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] -#[sea_orm(table_name = "city")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false)] - pub city_id: i32, - pub city: String, - #[sea_orm(column_type = "Custom(\"BLOB\".to_owned())")] - pub country_id: String, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::country::Entity", - from = "Column::CountryId", - to = "super::country::Column::CountryId", - on_update = "Cascade", - on_delete = "NoAction" - )] - Country, - #[sea_orm(has_many = "super::address::Entity")] - Address, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Country.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Address.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/compact/country.rs b/issues/386/src/compact/country.rs deleted file mode 100644 index 9fe96829..00000000 --- a/issues/386/src/compact/country.rs +++ /dev/null @@ -1,30 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] -#[sea_orm(table_name = "country")] -pub struct Model { - #[sea_orm( - primary_key, - auto_increment = false, - column_type = "Custom(\"BLOB\".to_owned())" - )] - pub country_id: String, - pub country: String, - pub last_update: Option, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm(has_many = "super::city::Entity")] - City, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::City.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/compact/customer.rs b/issues/386/src/compact/customer.rs deleted file mode 100644 index 95807b65..00000000 --- a/issues/386/src/compact/customer.rs +++ /dev/null @@ -1,69 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] -#[sea_orm(table_name = "customer")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false)] - pub customer_id: i32, - pub store_id: i32, - pub first_name: String, - pub last_name: String, - pub email: Option, - pub address_id: i32, - #[sea_orm(column_type = "Custom(\"BLOB\".to_owned())")] - pub active: String, - pub create_date: DateTime, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::address::Entity", - from = "Column::AddressId", - to = "super::address::Column::AddressId", - on_update = "Cascade", - on_delete = "NoAction" - )] - Address, - #[sea_orm( - belongs_to = "super::store::Entity", - from = "Column::StoreId", - to = "super::store::Column::StoreId", - on_update = "Cascade", - on_delete = "NoAction" - )] - Store, - #[sea_orm(has_many = "super::payment::Entity")] - Payment, - #[sea_orm(has_many = "super::rental::Entity")] - Rental, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Address.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Store.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Payment.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Rental.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/compact/film.rs b/issues/386/src/compact/film.rs deleted file mode 100644 index 39cf0330..00000000 --- a/issues/386/src/compact/film.rs +++ /dev/null @@ -1,75 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] -#[sea_orm(table_name = "film")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false)] - pub film_id: i32, - pub title: String, - #[sea_orm(column_type = "Custom(\"BLOB\".to_owned())", nullable)] - pub description: Option, - pub release_year: Option, - #[sea_orm(column_type = "Custom(\"BLOB\".to_owned())")] - pub language_id: String, - #[sea_orm(column_type = "Custom(\"BLOB\".to_owned())", nullable)] - pub original_language_id: Option, - #[sea_orm(column_type = "Custom(\"BLOB\".to_owned())")] - pub rental_duration: String, - #[sea_orm(column_type = "Decimal(Some((4, 2)))")] - pub rental_rate: Decimal, - #[sea_orm(column_type = "Custom(\"BLOB\".to_owned())", nullable)] - pub length: Option, - #[sea_orm(column_type = "Decimal(Some((5, 2)))")] - pub replacement_cost: Decimal, - pub rating: Option, - pub special_features: Option, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::language::Entity", - from = "Column::OriginalLanguageId", - to = "super::language::Column::LanguageId", - on_update = "NoAction", - on_delete = "NoAction" - )] - Language2, - #[sea_orm( - belongs_to = "super::language::Entity", - from = "Column::LanguageId", - to = "super::language::Column::LanguageId", - on_update = "NoAction", - on_delete = "NoAction" - )] - Language1, - #[sea_orm(has_many = "super::film_actor::Entity")] - FilmActor, - #[sea_orm(has_many = "super::film_category::Entity")] - FilmCategory, - #[sea_orm(has_many = "super::inventory::Entity")] - Inventory, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::FilmActor.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::FilmCategory.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Inventory.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/compact/film_actor.rs b/issues/386/src/compact/film_actor.rs deleted file mode 100644 index ba23ccb7..00000000 --- a/issues/386/src/compact/film_actor.rs +++ /dev/null @@ -1,47 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] -#[sea_orm(table_name = "film_actor")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false)] - pub actor_id: i32, - #[sea_orm(primary_key, auto_increment = false)] - pub film_id: i32, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::film::Entity", - from = "Column::FilmId", - to = "super::film::Column::FilmId", - on_update = "Cascade", - on_delete = "NoAction" - )] - Film, - #[sea_orm( - belongs_to = "super::actor::Entity", - from = "Column::ActorId", - to = "super::actor::Column::ActorId", - on_update = "Cascade", - on_delete = "NoAction" - )] - Actor, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Film.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Actor.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/compact/film_category.rs b/issues/386/src/compact/film_category.rs deleted file mode 100644 index 222a773a..00000000 --- a/issues/386/src/compact/film_category.rs +++ /dev/null @@ -1,51 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] -#[sea_orm(table_name = "film_category")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false)] - pub film_id: i32, - #[sea_orm( - primary_key, - auto_increment = false, - column_type = "Custom(\"BLOB\".to_owned())" - )] - pub category_id: String, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::category::Entity", - from = "Column::CategoryId", - to = "super::category::Column::CategoryId", - on_update = "Cascade", - on_delete = "NoAction" - )] - Category, - #[sea_orm( - belongs_to = "super::film::Entity", - from = "Column::FilmId", - to = "super::film::Column::FilmId", - on_update = "Cascade", - on_delete = "NoAction" - )] - Film, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Category.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Film.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/compact/film_text.rs b/issues/386/src/compact/film_text.rs deleted file mode 100644 index d8f26b69..00000000 --- a/issues/386/src/compact/film_text.rs +++ /dev/null @@ -1,28 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] -#[sea_orm(table_name = "film_text")] -pub struct Model { - #[sea_orm( - primary_key, - auto_increment = false, - column_type = "Custom(\"BLOB\".to_owned())" - )] - pub film_id: String, - pub title: String, - #[sea_orm(column_type = "Custom(\"BLOB\".to_owned())", nullable)] - pub description: Option, -} - -#[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation {} - -impl RelationTrait for Relation { - fn def(&self) -> RelationDef { - panic!("No RelationDef") - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/compact/inventory.rs b/issues/386/src/compact/inventory.rs deleted file mode 100644 index 2f71f5c4..00000000 --- a/issues/386/src/compact/inventory.rs +++ /dev/null @@ -1,55 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] -#[sea_orm(table_name = "inventory")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false)] - pub inventory_id: i32, - pub film_id: i32, - pub store_id: i32, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::film::Entity", - from = "Column::FilmId", - to = "super::film::Column::FilmId", - on_update = "Cascade", - on_delete = "NoAction" - )] - Film, - #[sea_orm( - belongs_to = "super::store::Entity", - from = "Column::StoreId", - to = "super::store::Column::StoreId", - on_update = "Cascade", - on_delete = "NoAction" - )] - Store, - #[sea_orm(has_many = "super::rental::Entity")] - Rental, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Film.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Store.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Rental.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/compact/language.rs b/issues/386/src/compact/language.rs deleted file mode 100644 index d77db368..00000000 --- a/issues/386/src/compact/language.rs +++ /dev/null @@ -1,28 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] -#[sea_orm(table_name = "language")] -pub struct Model { - #[sea_orm( - primary_key, - auto_increment = false, - column_type = "Custom(\"BLOB\".to_owned())" - )] - pub language_id: String, - #[sea_orm(column_type = "Custom(\"BLOB\".to_owned())")] - pub name: String, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation {} - -impl RelationTrait for Relation { - fn def(&self) -> RelationDef { - panic!("No RelationDef") - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/compact/mod.rs b/issues/386/src/compact/mod.rs deleted file mode 100644 index d7f098fc..00000000 --- a/issues/386/src/compact/mod.rs +++ /dev/null @@ -1,20 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -pub mod prelude; - -pub mod actor; -pub mod address; -pub mod category; -pub mod city; -pub mod country; -pub mod customer; -pub mod film; -pub mod film_actor; -pub mod film_category; -pub mod film_text; -pub mod inventory; -pub mod language; -pub mod payment; -pub mod rental; -pub mod staff; -pub mod store; diff --git a/issues/386/src/compact/payment.rs b/issues/386/src/compact/payment.rs deleted file mode 100644 index 43c494b4..00000000 --- a/issues/386/src/compact/payment.rs +++ /dev/null @@ -1,66 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] -#[sea_orm(table_name = "payment")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false)] - pub payment_id: i32, - pub customer_id: i32, - #[sea_orm(column_type = "Custom(\"BLOB\".to_owned())")] - pub staff_id: String, - pub rental_id: Option, - #[sea_orm(column_type = "Decimal(Some((5, 2)))")] - pub amount: Decimal, - pub payment_date: DateTime, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::staff::Entity", - from = "Column::StaffId", - to = "super::staff::Column::StaffId", - on_update = "NoAction", - on_delete = "NoAction" - )] - Staff, - #[sea_orm( - belongs_to = "super::customer::Entity", - from = "Column::CustomerId", - to = "super::customer::Column::CustomerId", - on_update = "NoAction", - on_delete = "NoAction" - )] - Customer, - #[sea_orm( - belongs_to = "super::rental::Entity", - from = "Column::RentalId", - to = "super::rental::Column::RentalId", - on_update = "Cascade", - on_delete = "SetNull" - )] - Rental, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Staff.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Customer.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Rental.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/compact/prelude.rs b/issues/386/src/compact/prelude.rs deleted file mode 100644 index 85cecd87..00000000 --- a/issues/386/src/compact/prelude.rs +++ /dev/null @@ -1,18 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -pub use super::actor::Entity as Actor; -pub use super::address::Entity as Address; -pub use super::category::Entity as Category; -pub use super::city::Entity as City; -pub use super::country::Entity as Country; -pub use super::customer::Entity as Customer; -pub use super::film::Entity as Film; -pub use super::film_actor::Entity as FilmActor; -pub use super::film_category::Entity as FilmCategory; -pub use super::film_text::Entity as FilmText; -pub use super::inventory::Entity as Inventory; -pub use super::language::Entity as Language; -pub use super::payment::Entity as Payment; -pub use super::rental::Entity as Rental; -pub use super::staff::Entity as Staff; -pub use super::store::Entity as Store; diff --git a/issues/386/src/compact/rental.rs b/issues/386/src/compact/rental.rs deleted file mode 100644 index 15c7e9d9..00000000 --- a/issues/386/src/compact/rental.rs +++ /dev/null @@ -1,73 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] -#[sea_orm(table_name = "rental")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false)] - pub rental_id: i32, - pub rental_date: DateTime, - pub inventory_id: i32, - pub customer_id: i32, - pub return_date: Option, - #[sea_orm(column_type = "Custom(\"BLOB\".to_owned())")] - pub staff_id: String, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::customer::Entity", - from = "Column::CustomerId", - to = "super::customer::Column::CustomerId", - on_update = "NoAction", - on_delete = "NoAction" - )] - Customer, - #[sea_orm( - belongs_to = "super::inventory::Entity", - from = "Column::InventoryId", - to = "super::inventory::Column::InventoryId", - on_update = "NoAction", - on_delete = "NoAction" - )] - Inventory, - #[sea_orm( - belongs_to = "super::staff::Entity", - from = "Column::StaffId", - to = "super::staff::Column::StaffId", - on_update = "NoAction", - on_delete = "NoAction" - )] - Staff, - #[sea_orm(has_many = "super::payment::Entity")] - Payment, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Customer.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Inventory.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Staff.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Payment.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/compact/staff.rs b/issues/386/src/compact/staff.rs deleted file mode 100644 index 805e5a26..00000000 --- a/issues/386/src/compact/staff.rs +++ /dev/null @@ -1,76 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] -#[sea_orm(table_name = "staff")] -pub struct Model { - #[sea_orm( - primary_key, - auto_increment = false, - column_type = "Custom(\"BLOB\".to_owned())" - )] - pub staff_id: String, - pub first_name: String, - pub last_name: String, - pub address_id: i32, - #[sea_orm(column_type = "Custom(\"BLOB\".to_owned())", nullable)] - pub picture: Option, - pub email: Option, - pub store_id: i32, - #[sea_orm(column_type = "Custom(\"BLOB\".to_owned())")] - pub active: String, - pub username: String, - pub password: Option, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::address::Entity", - from = "Column::AddressId", - to = "super::address::Column::AddressId", - on_update = "Cascade", - on_delete = "NoAction" - )] - Address, - #[sea_orm( - belongs_to = "super::store::Entity", - from = "Column::StoreId", - to = "super::store::Column::StoreId", - on_update = "Cascade", - on_delete = "NoAction" - )] - Store, - #[sea_orm(has_many = "super::payment::Entity")] - Payment, - #[sea_orm(has_many = "super::rental::Entity")] - Rental, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Address.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Store.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Payment.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Rental.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/compact/store.rs b/issues/386/src/compact/store.rs deleted file mode 100644 index f7e1eb4a..00000000 --- a/issues/386/src/compact/store.rs +++ /dev/null @@ -1,64 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel)] -#[sea_orm(table_name = "store")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false)] - pub store_id: i32, - #[sea_orm(column_type = "Custom(\"BLOB\".to_owned())")] - pub manager_staff_id: String, - pub address_id: i32, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::address::Entity", - from = "Column::AddressId", - to = "super::address::Column::AddressId", - on_update = "NoAction", - on_delete = "NoAction" - )] - Address, - #[sea_orm( - belongs_to = "super::staff::Entity", - from = "Column::ManagerStaffId", - to = "super::staff::Column::StaffId", - on_update = "NoAction", - on_delete = "NoAction" - )] - Staff, - #[sea_orm(has_many = "super::customer::Entity")] - Customer, - #[sea_orm(has_many = "super::inventory::Entity")] - Inventory, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Address.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Staff.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Customer.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Inventory.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/expanded/actor.rs b/issues/386/src/expanded/actor.rs deleted file mode 100644 index 578d11b2..00000000 --- a/issues/386/src/expanded/actor.rs +++ /dev/null @@ -1,73 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Copy, Clone, Default, Debug, DeriveEntity)] -pub struct Entity; - -impl EntityName for Entity { - fn table_name(&self) -> &str { - "actor" - } -} - -#[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel)] -pub struct Model { - pub actor_id: i32, - pub first_name: String, - pub last_name: String, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] -pub enum Column { - ActorId, - FirstName, - LastName, - LastUpdate, -} - -#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)] -pub enum PrimaryKey { - ActorId, -} - -impl PrimaryKeyTrait for PrimaryKey { - type ValueType = i32; - fn auto_increment() -> bool { - true - } -} - -#[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation { - FilmActor, -} - -impl ColumnTrait for Column { - type EntityName = Entity; - fn def(&self) -> ColumnDef { - match self { - Self::ActorId => ColumnType::Integer.def(), - Self::FirstName => ColumnType::String(None).def(), - Self::LastName => ColumnType::String(None).def(), - Self::LastUpdate => ColumnType::Timestamp.def(), - } - } -} - -impl RelationTrait for Relation { - fn def(&self) -> RelationDef { - match self { - Self::FilmActor => Entity::has_many(super::film_actor::Entity).into(), - } - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::FilmActor.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/expanded/address.rs b/issues/386/src/expanded/address.rs deleted file mode 100644 index e8b9a5b8..00000000 --- a/issues/386/src/expanded/address.rs +++ /dev/null @@ -1,112 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Copy, Clone, Default, Debug, DeriveEntity)] -pub struct Entity; - -impl EntityName for Entity { - fn table_name(&self) -> &str { - "address" - } -} - -#[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel)] -pub struct Model { - pub address_id: i32, - pub address: String, - pub address2: Option, - pub district: String, - pub city_id: i32, - pub postal_code: Option, - pub phone: String, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] -pub enum Column { - AddressId, - Address, - Address2, - District, - CityId, - PostalCode, - Phone, - LastUpdate, -} - -#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)] -pub enum PrimaryKey { - AddressId, -} - -impl PrimaryKeyTrait for PrimaryKey { - type ValueType = i32; - fn auto_increment() -> bool { - false - } -} - -#[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation { - City, - Customer, - Staff, - Store, -} - -impl ColumnTrait for Column { - type EntityName = Entity; - fn def(&self) -> ColumnDef { - match self { - Self::AddressId => ColumnType::Integer.def(), - Self::Address => ColumnType::String(None).def(), - Self::Address2 => ColumnType::String(None).def().null(), - Self::District => ColumnType::String(None).def(), - Self::CityId => ColumnType::Integer.def(), - Self::PostalCode => ColumnType::String(None).def().null(), - Self::Phone => ColumnType::String(None).def(), - Self::LastUpdate => ColumnType::Timestamp.def(), - } - } -} - -impl RelationTrait for Relation { - fn def(&self) -> RelationDef { - match self { - Self::City => Entity::belongs_to(super::city::Entity) - .from(Column::CityId) - .to(super::city::Column::CityId) - .into(), - Self::Customer => Entity::has_many(super::customer::Entity).into(), - Self::Staff => Entity::has_many(super::staff::Entity).into(), - Self::Store => Entity::has_many(super::store::Entity).into(), - } - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::City.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Customer.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Staff.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Store.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/expanded/category.rs b/issues/386/src/expanded/category.rs deleted file mode 100644 index 4ce53b6a..00000000 --- a/issues/386/src/expanded/category.rs +++ /dev/null @@ -1,70 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Copy, Clone, Default, Debug, DeriveEntity)] -pub struct Entity; - -impl EntityName for Entity { - fn table_name(&self) -> &str { - "category" - } -} - -#[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel)] -pub struct Model { - pub category_id: String, - pub name: String, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] -pub enum Column { - CategoryId, - Name, - LastUpdate, -} - -#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)] -pub enum PrimaryKey { - CategoryId, -} - -impl PrimaryKeyTrait for PrimaryKey { - type ValueType = String; - fn auto_increment() -> bool { - false - } -} - -#[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation { - FilmCategory, -} - -impl ColumnTrait for Column { - type EntityName = Entity; - fn def(&self) -> ColumnDef { - match self { - Self::CategoryId => ColumnType::Custom("BLOB".to_owned()).def(), - Self::Name => ColumnType::String(None).def(), - Self::LastUpdate => ColumnType::Timestamp.def(), - } - } -} - -impl RelationTrait for Relation { - fn def(&self) -> RelationDef { - match self { - Self::FilmCategory => Entity::has_many(super::film_category::Entity).into(), - } - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::FilmCategory.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/expanded/city.rs b/issues/386/src/expanded/city.rs deleted file mode 100644 index eb4010d2..00000000 --- a/issues/386/src/expanded/city.rs +++ /dev/null @@ -1,84 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Copy, Clone, Default, Debug, DeriveEntity)] -pub struct Entity; - -impl EntityName for Entity { - fn table_name(&self) -> &str { - "city" - } -} - -#[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel)] -pub struct Model { - pub city_id: i32, - pub city: String, - pub country_id: String, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] -pub enum Column { - CityId, - City, - CountryId, - LastUpdate, -} - -#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)] -pub enum PrimaryKey { - CityId, -} - -impl PrimaryKeyTrait for PrimaryKey { - type ValueType = i32; - fn auto_increment() -> bool { - false - } -} - -#[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation { - Country, - Address, -} - -impl ColumnTrait for Column { - type EntityName = Entity; - fn def(&self) -> ColumnDef { - match self { - Self::CityId => ColumnType::Integer.def(), - Self::City => ColumnType::String(None).def(), - Self::CountryId => ColumnType::Custom("BLOB".to_owned()).def(), - Self::LastUpdate => ColumnType::Timestamp.def(), - } - } -} - -impl RelationTrait for Relation { - fn def(&self) -> RelationDef { - match self { - Self::Country => Entity::belongs_to(super::country::Entity) - .from(Column::CountryId) - .to(super::country::Column::CountryId) - .into(), - Self::Address => Entity::has_many(super::address::Entity).into(), - } - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Country.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Address.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/expanded/country.rs b/issues/386/src/expanded/country.rs deleted file mode 100644 index 5901ccbc..00000000 --- a/issues/386/src/expanded/country.rs +++ /dev/null @@ -1,70 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Copy, Clone, Default, Debug, DeriveEntity)] -pub struct Entity; - -impl EntityName for Entity { - fn table_name(&self) -> &str { - "country" - } -} - -#[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel)] -pub struct Model { - pub country_id: String, - pub country: String, - pub last_update: Option, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] -pub enum Column { - CountryId, - Country, - LastUpdate, -} - -#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)] -pub enum PrimaryKey { - CountryId, -} - -impl PrimaryKeyTrait for PrimaryKey { - type ValueType = String; - fn auto_increment() -> bool { - false - } -} - -#[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation { - City, -} - -impl ColumnTrait for Column { - type EntityName = Entity; - fn def(&self) -> ColumnDef { - match self { - Self::CountryId => ColumnType::Custom("BLOB".to_owned()).def(), - Self::Country => ColumnType::String(None).def(), - Self::LastUpdate => ColumnType::Timestamp.def().null(), - } - } -} - -impl RelationTrait for Relation { - fn def(&self) -> RelationDef { - match self { - Self::City => Entity::has_many(super::city::Entity).into(), - } - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::City.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/expanded/customer.rs b/issues/386/src/expanded/customer.rs deleted file mode 100644 index 1adbaa66..00000000 --- a/issues/386/src/expanded/customer.rs +++ /dev/null @@ -1,118 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Copy, Clone, Default, Debug, DeriveEntity)] -pub struct Entity; - -impl EntityName for Entity { - fn table_name(&self) -> &str { - "customer" - } -} - -#[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel)] -pub struct Model { - pub customer_id: i32, - pub store_id: i32, - pub first_name: String, - pub last_name: String, - pub email: Option, - pub address_id: i32, - pub active: String, - pub create_date: DateTime, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] -pub enum Column { - CustomerId, - StoreId, - FirstName, - LastName, - Email, - AddressId, - Active, - CreateDate, - LastUpdate, -} - -#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)] -pub enum PrimaryKey { - CustomerId, -} - -impl PrimaryKeyTrait for PrimaryKey { - type ValueType = i32; - fn auto_increment() -> bool { - false - } -} - -#[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation { - Address, - Store, - Payment, - Rental, -} - -impl ColumnTrait for Column { - type EntityName = Entity; - fn def(&self) -> ColumnDef { - match self { - Self::CustomerId => ColumnType::Integer.def(), - Self::StoreId => ColumnType::Integer.def(), - Self::FirstName => ColumnType::String(None).def(), - Self::LastName => ColumnType::String(None).def(), - Self::Email => ColumnType::String(None).def().null(), - Self::AddressId => ColumnType::Integer.def(), - Self::Active => ColumnType::Custom("BLOB".to_owned()).def(), - Self::CreateDate => ColumnType::Timestamp.def(), - Self::LastUpdate => ColumnType::Timestamp.def(), - } - } -} - -impl RelationTrait for Relation { - fn def(&self) -> RelationDef { - match self { - Self::Address => Entity::belongs_to(super::address::Entity) - .from(Column::AddressId) - .to(super::address::Column::AddressId) - .into(), - Self::Store => Entity::belongs_to(super::store::Entity) - .from(Column::StoreId) - .to(super::store::Column::StoreId) - .into(), - Self::Payment => Entity::has_many(super::payment::Entity).into(), - Self::Rental => Entity::has_many(super::rental::Entity).into(), - } - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Address.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Store.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Payment.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Rental.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/expanded/film.rs b/issues/386/src/expanded/film.rs deleted file mode 100644 index b4e12ce3..00000000 --- a/issues/386/src/expanded/film.rs +++ /dev/null @@ -1,126 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Copy, Clone, Default, Debug, DeriveEntity)] -pub struct Entity; - -impl EntityName for Entity { - fn table_name(&self) -> &str { - "film" - } -} - -#[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel)] -pub struct Model { - pub film_id: i32, - pub title: String, - pub description: Option, - pub release_year: Option, - pub language_id: String, - pub original_language_id: Option, - pub rental_duration: String, - pub rental_rate: Decimal, - pub length: Option, - pub replacement_cost: Decimal, - pub rating: Option, - pub special_features: Option, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] -pub enum Column { - FilmId, - Title, - Description, - ReleaseYear, - LanguageId, - OriginalLanguageId, - RentalDuration, - RentalRate, - Length, - ReplacementCost, - Rating, - SpecialFeatures, - LastUpdate, -} - -#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)] -pub enum PrimaryKey { - FilmId, -} - -impl PrimaryKeyTrait for PrimaryKey { - type ValueType = i32; - fn auto_increment() -> bool { - false - } -} - -#[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation { - Language2, - Language1, - FilmActor, - FilmCategory, - Inventory, -} - -impl ColumnTrait for Column { - type EntityName = Entity; - fn def(&self) -> ColumnDef { - match self { - Self::FilmId => ColumnType::Integer.def(), - Self::Title => ColumnType::String(None).def(), - Self::Description => ColumnType::Custom("BLOB".to_owned()).def().null(), - Self::ReleaseYear => ColumnType::String(None).def().null(), - Self::LanguageId => ColumnType::Custom("BLOB".to_owned()).def(), - Self::OriginalLanguageId => ColumnType::Custom("BLOB".to_owned()).def().null(), - Self::RentalDuration => ColumnType::Custom("BLOB".to_owned()).def(), - Self::RentalRate => ColumnType::Decimal(Some((4u32, 2u32))).def(), - Self::Length => ColumnType::Custom("BLOB".to_owned()).def().null(), - Self::ReplacementCost => ColumnType::Decimal(Some((5u32, 2u32))).def(), - Self::Rating => ColumnType::String(None).def().null(), - Self::SpecialFeatures => ColumnType::String(None).def().null(), - Self::LastUpdate => ColumnType::Timestamp.def(), - } - } -} - -impl RelationTrait for Relation { - fn def(&self) -> RelationDef { - match self { - Self::Language2 => Entity::belongs_to(super::language::Entity) - .from(Column::OriginalLanguageId) - .to(super::language::Column::LanguageId) - .into(), - Self::Language1 => Entity::belongs_to(super::language::Entity) - .from(Column::LanguageId) - .to(super::language::Column::LanguageId) - .into(), - Self::FilmActor => Entity::has_many(super::film_actor::Entity).into(), - Self::FilmCategory => Entity::has_many(super::film_category::Entity).into(), - Self::Inventory => Entity::has_many(super::inventory::Entity).into(), - } - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::FilmActor.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::FilmCategory.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Inventory.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/expanded/film_actor.rs b/issues/386/src/expanded/film_actor.rs deleted file mode 100644 index 86211cec..00000000 --- a/issues/386/src/expanded/film_actor.rs +++ /dev/null @@ -1,85 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Copy, Clone, Default, Debug, DeriveEntity)] -pub struct Entity; - -impl EntityName for Entity { - fn table_name(&self) -> &str { - "film_actor" - } -} - -#[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel)] -pub struct Model { - pub actor_id: i32, - pub film_id: i32, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] -pub enum Column { - ActorId, - FilmId, - LastUpdate, -} - -#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)] -pub enum PrimaryKey { - ActorId, - FilmId, -} - -impl PrimaryKeyTrait for PrimaryKey { - type ValueType = (i32, i32); - fn auto_increment() -> bool { - false - } -} - -#[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation { - Film, - Actor, -} - -impl ColumnTrait for Column { - type EntityName = Entity; - fn def(&self) -> ColumnDef { - match self { - Self::ActorId => ColumnType::Integer.def(), - Self::FilmId => ColumnType::Integer.def(), - Self::LastUpdate => ColumnType::Timestamp.def(), - } - } -} - -impl RelationTrait for Relation { - fn def(&self) -> RelationDef { - match self { - Self::Film => Entity::belongs_to(super::film::Entity) - .from(Column::FilmId) - .to(super::film::Column::FilmId) - .into(), - Self::Actor => Entity::belongs_to(super::actor::Entity) - .from(Column::ActorId) - .to(super::actor::Column::ActorId) - .into(), - } - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Film.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Actor.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/expanded/film_category.rs b/issues/386/src/expanded/film_category.rs deleted file mode 100644 index c1cc118a..00000000 --- a/issues/386/src/expanded/film_category.rs +++ /dev/null @@ -1,85 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Copy, Clone, Default, Debug, DeriveEntity)] -pub struct Entity; - -impl EntityName for Entity { - fn table_name(&self) -> &str { - "film_category" - } -} - -#[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel)] -pub struct Model { - pub film_id: i32, - pub category_id: String, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] -pub enum Column { - FilmId, - CategoryId, - LastUpdate, -} - -#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)] -pub enum PrimaryKey { - FilmId, - CategoryId, -} - -impl PrimaryKeyTrait for PrimaryKey { - type ValueType = (i32, String); - fn auto_increment() -> bool { - false - } -} - -#[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation { - Category, - Film, -} - -impl ColumnTrait for Column { - type EntityName = Entity; - fn def(&self) -> ColumnDef { - match self { - Self::FilmId => ColumnType::Integer.def(), - Self::CategoryId => ColumnType::Custom("BLOB".to_owned()).def(), - Self::LastUpdate => ColumnType::Timestamp.def(), - } - } -} - -impl RelationTrait for Relation { - fn def(&self) -> RelationDef { - match self { - Self::Category => Entity::belongs_to(super::category::Entity) - .from(Column::CategoryId) - .to(super::category::Column::CategoryId) - .into(), - Self::Film => Entity::belongs_to(super::film::Entity) - .from(Column::FilmId) - .to(super::film::Column::FilmId) - .into(), - } - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Category.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Film.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/expanded/film_text.rs b/issues/386/src/expanded/film_text.rs deleted file mode 100644 index 87dbeda4..00000000 --- a/issues/386/src/expanded/film_text.rs +++ /dev/null @@ -1,60 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Copy, Clone, Default, Debug, DeriveEntity)] -pub struct Entity; - -impl EntityName for Entity { - fn table_name(&self) -> &str { - "film_text" - } -} - -#[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel)] -pub struct Model { - pub film_id: String, - pub title: String, - pub description: Option, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] -pub enum Column { - FilmId, - Title, - Description, -} - -#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)] -pub enum PrimaryKey { - FilmId, -} - -impl PrimaryKeyTrait for PrimaryKey { - type ValueType = String; - fn auto_increment() -> bool { - false - } -} - -#[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation {} - -impl ColumnTrait for Column { - type EntityName = Entity; - fn def(&self) -> ColumnDef { - match self { - Self::FilmId => ColumnType::Custom("BLOB".to_owned()).def(), - Self::Title => ColumnType::String(None).def(), - Self::Description => ColumnType::Custom("BLOB".to_owned()).def().null(), - } - } -} - -impl RelationTrait for Relation { - fn def(&self) -> RelationDef { - panic!("No RelationDef") - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/expanded/inventory.rs b/issues/386/src/expanded/inventory.rs deleted file mode 100644 index dbbb412b..00000000 --- a/issues/386/src/expanded/inventory.rs +++ /dev/null @@ -1,95 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Copy, Clone, Default, Debug, DeriveEntity)] -pub struct Entity; - -impl EntityName for Entity { - fn table_name(&self) -> &str { - "inventory" - } -} - -#[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel)] -pub struct Model { - pub inventory_id: i32, - pub film_id: i32, - pub store_id: i32, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] -pub enum Column { - InventoryId, - FilmId, - StoreId, - LastUpdate, -} - -#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)] -pub enum PrimaryKey { - InventoryId, -} - -impl PrimaryKeyTrait for PrimaryKey { - type ValueType = i32; - fn auto_increment() -> bool { - false - } -} - -#[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation { - Film, - Store, - Rental, -} - -impl ColumnTrait for Column { - type EntityName = Entity; - fn def(&self) -> ColumnDef { - match self { - Self::InventoryId => ColumnType::Integer.def(), - Self::FilmId => ColumnType::Integer.def(), - Self::StoreId => ColumnType::Integer.def(), - Self::LastUpdate => ColumnType::Timestamp.def(), - } - } -} - -impl RelationTrait for Relation { - fn def(&self) -> RelationDef { - match self { - Self::Film => Entity::belongs_to(super::film::Entity) - .from(Column::FilmId) - .to(super::film::Column::FilmId) - .into(), - Self::Store => Entity::belongs_to(super::store::Entity) - .from(Column::StoreId) - .to(super::store::Column::StoreId) - .into(), - Self::Rental => Entity::has_many(super::rental::Entity).into(), - } - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Film.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Store.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Rental.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/expanded/language.rs b/issues/386/src/expanded/language.rs deleted file mode 100644 index cffd118e..00000000 --- a/issues/386/src/expanded/language.rs +++ /dev/null @@ -1,60 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Copy, Clone, Default, Debug, DeriveEntity)] -pub struct Entity; - -impl EntityName for Entity { - fn table_name(&self) -> &str { - "language" - } -} - -#[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel)] -pub struct Model { - pub language_id: String, - pub name: String, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] -pub enum Column { - LanguageId, - Name, - LastUpdate, -} - -#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)] -pub enum PrimaryKey { - LanguageId, -} - -impl PrimaryKeyTrait for PrimaryKey { - type ValueType = String; - fn auto_increment() -> bool { - false - } -} - -#[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation {} - -impl ColumnTrait for Column { - type EntityName = Entity; - fn def(&self) -> ColumnDef { - match self { - Self::LanguageId => ColumnType::Custom("BLOB".to_owned()).def(), - Self::Name => ColumnType::Custom("BLOB".to_owned()).def(), - Self::LastUpdate => ColumnType::Timestamp.def(), - } - } -} - -impl RelationTrait for Relation { - fn def(&self) -> RelationDef { - panic!("No RelationDef") - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/expanded/mod.rs b/issues/386/src/expanded/mod.rs deleted file mode 100644 index d7f098fc..00000000 --- a/issues/386/src/expanded/mod.rs +++ /dev/null @@ -1,20 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -pub mod prelude; - -pub mod actor; -pub mod address; -pub mod category; -pub mod city; -pub mod country; -pub mod customer; -pub mod film; -pub mod film_actor; -pub mod film_category; -pub mod film_text; -pub mod inventory; -pub mod language; -pub mod payment; -pub mod rental; -pub mod staff; -pub mod store; diff --git a/issues/386/src/expanded/payment.rs b/issues/386/src/expanded/payment.rs deleted file mode 100644 index 7977464b..00000000 --- a/issues/386/src/expanded/payment.rs +++ /dev/null @@ -1,107 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Copy, Clone, Default, Debug, DeriveEntity)] -pub struct Entity; - -impl EntityName for Entity { - fn table_name(&self) -> &str { - "payment" - } -} - -#[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel)] -pub struct Model { - pub payment_id: i32, - pub customer_id: i32, - pub staff_id: String, - pub rental_id: Option, - pub amount: Decimal, - pub payment_date: DateTime, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] -pub enum Column { - PaymentId, - CustomerId, - StaffId, - RentalId, - Amount, - PaymentDate, - LastUpdate, -} - -#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)] -pub enum PrimaryKey { - PaymentId, -} - -impl PrimaryKeyTrait for PrimaryKey { - type ValueType = i32; - fn auto_increment() -> bool { - false - } -} - -#[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation { - Staff, - Customer, - Rental, -} - -impl ColumnTrait for Column { - type EntityName = Entity; - fn def(&self) -> ColumnDef { - match self { - Self::PaymentId => ColumnType::Integer.def(), - Self::CustomerId => ColumnType::Integer.def(), - Self::StaffId => ColumnType::Custom("BLOB".to_owned()).def(), - Self::RentalId => ColumnType::Integer.def().null(), - Self::Amount => ColumnType::Decimal(Some((5u32, 2u32))).def(), - Self::PaymentDate => ColumnType::Timestamp.def(), - Self::LastUpdate => ColumnType::Timestamp.def(), - } - } -} - -impl RelationTrait for Relation { - fn def(&self) -> RelationDef { - match self { - Self::Staff => Entity::belongs_to(super::staff::Entity) - .from(Column::StaffId) - .to(super::staff::Column::StaffId) - .into(), - Self::Customer => Entity::belongs_to(super::customer::Entity) - .from(Column::CustomerId) - .to(super::customer::Column::CustomerId) - .into(), - Self::Rental => Entity::belongs_to(super::rental::Entity) - .from(Column::RentalId) - .to(super::rental::Column::RentalId) - .into(), - } - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Staff.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Customer.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Rental.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/expanded/prelude.rs b/issues/386/src/expanded/prelude.rs deleted file mode 100644 index 85cecd87..00000000 --- a/issues/386/src/expanded/prelude.rs +++ /dev/null @@ -1,18 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -pub use super::actor::Entity as Actor; -pub use super::address::Entity as Address; -pub use super::category::Entity as Category; -pub use super::city::Entity as City; -pub use super::country::Entity as Country; -pub use super::customer::Entity as Customer; -pub use super::film::Entity as Film; -pub use super::film_actor::Entity as FilmActor; -pub use super::film_category::Entity as FilmCategory; -pub use super::film_text::Entity as FilmText; -pub use super::inventory::Entity as Inventory; -pub use super::language::Entity as Language; -pub use super::payment::Entity as Payment; -pub use super::rental::Entity as Rental; -pub use super::staff::Entity as Staff; -pub use super::store::Entity as Store; diff --git a/issues/386/src/expanded/rental.rs b/issues/386/src/expanded/rental.rs deleted file mode 100644 index 952a0285..00000000 --- a/issues/386/src/expanded/rental.rs +++ /dev/null @@ -1,115 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Copy, Clone, Default, Debug, DeriveEntity)] -pub struct Entity; - -impl EntityName for Entity { - fn table_name(&self) -> &str { - "rental" - } -} - -#[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel)] -pub struct Model { - pub rental_id: i32, - pub rental_date: DateTime, - pub inventory_id: i32, - pub customer_id: i32, - pub return_date: Option, - pub staff_id: String, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] -pub enum Column { - RentalId, - RentalDate, - InventoryId, - CustomerId, - ReturnDate, - StaffId, - LastUpdate, -} - -#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)] -pub enum PrimaryKey { - RentalId, -} - -impl PrimaryKeyTrait for PrimaryKey { - type ValueType = i32; - fn auto_increment() -> bool { - false - } -} - -#[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation { - Customer, - Inventory, - Staff, - Payment, -} - -impl ColumnTrait for Column { - type EntityName = Entity; - fn def(&self) -> ColumnDef { - match self { - Self::RentalId => ColumnType::Integer.def(), - Self::RentalDate => ColumnType::Timestamp.def(), - Self::InventoryId => ColumnType::Integer.def(), - Self::CustomerId => ColumnType::Integer.def(), - Self::ReturnDate => ColumnType::Timestamp.def().null(), - Self::StaffId => ColumnType::Custom("BLOB".to_owned()).def(), - Self::LastUpdate => ColumnType::Timestamp.def(), - } - } -} - -impl RelationTrait for Relation { - fn def(&self) -> RelationDef { - match self { - Self::Customer => Entity::belongs_to(super::customer::Entity) - .from(Column::CustomerId) - .to(super::customer::Column::CustomerId) - .into(), - Self::Inventory => Entity::belongs_to(super::inventory::Entity) - .from(Column::InventoryId) - .to(super::inventory::Column::InventoryId) - .into(), - Self::Staff => Entity::belongs_to(super::staff::Entity) - .from(Column::StaffId) - .to(super::staff::Column::StaffId) - .into(), - Self::Payment => Entity::has_many(super::payment::Entity).into(), - } - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Customer.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Inventory.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Staff.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Payment.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/expanded/staff.rs b/issues/386/src/expanded/staff.rs deleted file mode 100644 index a24721cf..00000000 --- a/issues/386/src/expanded/staff.rs +++ /dev/null @@ -1,124 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Copy, Clone, Default, Debug, DeriveEntity)] -pub struct Entity; - -impl EntityName for Entity { - fn table_name(&self) -> &str { - "staff" - } -} - -#[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel)] -pub struct Model { - pub staff_id: String, - pub first_name: String, - pub last_name: String, - pub address_id: i32, - pub picture: Option, - pub email: Option, - pub store_id: i32, - pub active: String, - pub username: String, - pub password: Option, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] -pub enum Column { - StaffId, - FirstName, - LastName, - AddressId, - Picture, - Email, - StoreId, - Active, - Username, - Password, - LastUpdate, -} - -#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)] -pub enum PrimaryKey { - StaffId, -} - -impl PrimaryKeyTrait for PrimaryKey { - type ValueType = String; - fn auto_increment() -> bool { - false - } -} - -#[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation { - Address, - Store, - Payment, - Rental, -} - -impl ColumnTrait for Column { - type EntityName = Entity; - fn def(&self) -> ColumnDef { - match self { - Self::StaffId => ColumnType::Custom("BLOB".to_owned()).def(), - Self::FirstName => ColumnType::String(None).def(), - Self::LastName => ColumnType::String(None).def(), - Self::AddressId => ColumnType::Integer.def(), - Self::Picture => ColumnType::Custom("BLOB".to_owned()).def().null(), - Self::Email => ColumnType::String(None).def().null(), - Self::StoreId => ColumnType::Integer.def(), - Self::Active => ColumnType::Custom("BLOB".to_owned()).def(), - Self::Username => ColumnType::String(None).def(), - Self::Password => ColumnType::String(None).def().null(), - Self::LastUpdate => ColumnType::Timestamp.def(), - } - } -} - -impl RelationTrait for Relation { - fn def(&self) -> RelationDef { - match self { - Self::Address => Entity::belongs_to(super::address::Entity) - .from(Column::AddressId) - .to(super::address::Column::AddressId) - .into(), - Self::Store => Entity::belongs_to(super::store::Entity) - .from(Column::StoreId) - .to(super::store::Column::StoreId) - .into(), - Self::Payment => Entity::has_many(super::payment::Entity).into(), - Self::Rental => Entity::has_many(super::rental::Entity).into(), - } - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Address.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Store.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Payment.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Rental.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/expanded/store.rs b/issues/386/src/expanded/store.rs deleted file mode 100644 index 1d04fd66..00000000 --- a/issues/386/src/expanded/store.rs +++ /dev/null @@ -1,103 +0,0 @@ -//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 - -use sea_orm::entity::prelude::*; - -#[derive(Copy, Clone, Default, Debug, DeriveEntity)] -pub struct Entity; - -impl EntityName for Entity { - fn table_name(&self) -> &str { - "store" - } -} - -#[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel)] -pub struct Model { - pub store_id: i32, - pub manager_staff_id: String, - pub address_id: i32, - pub last_update: DateTime, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] -pub enum Column { - StoreId, - ManagerStaffId, - AddressId, - LastUpdate, -} - -#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)] -pub enum PrimaryKey { - StoreId, -} - -impl PrimaryKeyTrait for PrimaryKey { - type ValueType = i32; - fn auto_increment() -> bool { - false - } -} - -#[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation { - Address, - Staff, - Customer, - Inventory, -} - -impl ColumnTrait for Column { - type EntityName = Entity; - fn def(&self) -> ColumnDef { - match self { - Self::StoreId => ColumnType::Integer.def(), - Self::ManagerStaffId => ColumnType::Custom("BLOB".to_owned()).def(), - Self::AddressId => ColumnType::Integer.def(), - Self::LastUpdate => ColumnType::Timestamp.def(), - } - } -} - -impl RelationTrait for Relation { - fn def(&self) -> RelationDef { - match self { - Self::Address => Entity::belongs_to(super::address::Entity) - .from(Column::AddressId) - .to(super::address::Column::AddressId) - .into(), - Self::Staff => Entity::belongs_to(super::staff::Entity) - .from(Column::ManagerStaffId) - .to(super::staff::Column::StaffId) - .into(), - Self::Customer => Entity::has_many(super::customer::Entity).into(), - Self::Inventory => Entity::has_many(super::inventory::Entity).into(), - } - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Address.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Staff.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Customer.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Inventory.def() - } -} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/issues/386/src/main.rs b/issues/386/src/main.rs deleted file mode 100644 index c76f4650..00000000 --- a/issues/386/src/main.rs +++ /dev/null @@ -1,4 +0,0 @@ -mod compact; -mod expanded; - -pub fn main() {}