Remove issues/386

This commit is contained in:
Chris Tsang 2021-12-25 11:33:21 +08:00
parent 9036d27da7
commit 2bc5863977
39 changed files with 1 additions and 2401 deletions

View File

@ -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

View File

@ -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" ]}

View File

@ -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<super::film_actor::Entity> for Entity {
fn to() -> RelationDef {
Relation::FilmActor.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<String>,
pub district: String,
pub city_id: i32,
pub postal_code: Option<String>,
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<super::city::Entity> for Entity {
fn to() -> RelationDef {
Relation::City.def()
}
}
impl Related<super::customer::Entity> for Entity {
fn to() -> RelationDef {
Relation::Customer.def()
}
}
impl Related<super::staff::Entity> for Entity {
fn to() -> RelationDef {
Relation::Staff.def()
}
}
impl Related<super::store::Entity> for Entity {
fn to() -> RelationDef {
Relation::Store.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<super::film_category::Entity> for Entity {
fn to() -> RelationDef {
Relation::FilmCategory.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<super::country::Entity> for Entity {
fn to() -> RelationDef {
Relation::Country.def()
}
}
impl Related<super::address::Entity> for Entity {
fn to() -> RelationDef {
Relation::Address.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<DateTime>,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(has_many = "super::city::Entity")]
City,
}
impl Related<super::city::Entity> for Entity {
fn to() -> RelationDef {
Relation::City.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<String>,
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<super::address::Entity> for Entity {
fn to() -> RelationDef {
Relation::Address.def()
}
}
impl Related<super::store::Entity> for Entity {
fn to() -> RelationDef {
Relation::Store.def()
}
}
impl Related<super::payment::Entity> for Entity {
fn to() -> RelationDef {
Relation::Payment.def()
}
}
impl Related<super::rental::Entity> for Entity {
fn to() -> RelationDef {
Relation::Rental.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<String>,
pub release_year: Option<String>,
#[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<String>,
#[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<String>,
#[sea_orm(column_type = "Decimal(Some((5, 2)))")]
pub replacement_cost: Decimal,
pub rating: Option<String>,
pub special_features: Option<String>,
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<super::film_actor::Entity> for Entity {
fn to() -> RelationDef {
Relation::FilmActor.def()
}
}
impl Related<super::film_category::Entity> for Entity {
fn to() -> RelationDef {
Relation::FilmCategory.def()
}
}
impl Related<super::inventory::Entity> for Entity {
fn to() -> RelationDef {
Relation::Inventory.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<super::film::Entity> for Entity {
fn to() -> RelationDef {
Relation::Film.def()
}
}
impl Related<super::actor::Entity> for Entity {
fn to() -> RelationDef {
Relation::Actor.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<super::category::Entity> for Entity {
fn to() -> RelationDef {
Relation::Category.def()
}
}
impl Related<super::film::Entity> for Entity {
fn to() -> RelationDef {
Relation::Film.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<String>,
}
#[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {}
impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
panic!("No RelationDef")
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<super::film::Entity> for Entity {
fn to() -> RelationDef {
Relation::Film.def()
}
}
impl Related<super::store::Entity> for Entity {
fn to() -> RelationDef {
Relation::Store.def()
}
}
impl Related<super::rental::Entity> for Entity {
fn to() -> RelationDef {
Relation::Rental.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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 {}

View File

@ -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;

View File

@ -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<i32>,
#[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<super::staff::Entity> for Entity {
fn to() -> RelationDef {
Relation::Staff.def()
}
}
impl Related<super::customer::Entity> for Entity {
fn to() -> RelationDef {
Relation::Customer.def()
}
}
impl Related<super::rental::Entity> for Entity {
fn to() -> RelationDef {
Relation::Rental.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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;

View File

@ -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<DateTime>,
#[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<super::customer::Entity> for Entity {
fn to() -> RelationDef {
Relation::Customer.def()
}
}
impl Related<super::inventory::Entity> for Entity {
fn to() -> RelationDef {
Relation::Inventory.def()
}
}
impl Related<super::staff::Entity> for Entity {
fn to() -> RelationDef {
Relation::Staff.def()
}
}
impl Related<super::payment::Entity> for Entity {
fn to() -> RelationDef {
Relation::Payment.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<String>,
pub email: Option<String>,
pub store_id: i32,
#[sea_orm(column_type = "Custom(\"BLOB\".to_owned())")]
pub active: String,
pub username: String,
pub password: Option<String>,
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<super::address::Entity> for Entity {
fn to() -> RelationDef {
Relation::Address.def()
}
}
impl Related<super::store::Entity> for Entity {
fn to() -> RelationDef {
Relation::Store.def()
}
}
impl Related<super::payment::Entity> for Entity {
fn to() -> RelationDef {
Relation::Payment.def()
}
}
impl Related<super::rental::Entity> for Entity {
fn to() -> RelationDef {
Relation::Rental.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<super::address::Entity> for Entity {
fn to() -> RelationDef {
Relation::Address.def()
}
}
impl Related<super::staff::Entity> for Entity {
fn to() -> RelationDef {
Relation::Staff.def()
}
}
impl Related<super::customer::Entity> for Entity {
fn to() -> RelationDef {
Relation::Customer.def()
}
}
impl Related<super::inventory::Entity> for Entity {
fn to() -> RelationDef {
Relation::Inventory.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<super::film_actor::Entity> for Entity {
fn to() -> RelationDef {
Relation::FilmActor.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<String>,
pub district: String,
pub city_id: i32,
pub postal_code: Option<String>,
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<super::city::Entity> for Entity {
fn to() -> RelationDef {
Relation::City.def()
}
}
impl Related<super::customer::Entity> for Entity {
fn to() -> RelationDef {
Relation::Customer.def()
}
}
impl Related<super::staff::Entity> for Entity {
fn to() -> RelationDef {
Relation::Staff.def()
}
}
impl Related<super::store::Entity> for Entity {
fn to() -> RelationDef {
Relation::Store.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<super::film_category::Entity> for Entity {
fn to() -> RelationDef {
Relation::FilmCategory.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<super::country::Entity> for Entity {
fn to() -> RelationDef {
Relation::Country.def()
}
}
impl Related<super::address::Entity> for Entity {
fn to() -> RelationDef {
Relation::Address.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<DateTime>,
}
#[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<super::city::Entity> for Entity {
fn to() -> RelationDef {
Relation::City.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<String>,
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<super::address::Entity> for Entity {
fn to() -> RelationDef {
Relation::Address.def()
}
}
impl Related<super::store::Entity> for Entity {
fn to() -> RelationDef {
Relation::Store.def()
}
}
impl Related<super::payment::Entity> for Entity {
fn to() -> RelationDef {
Relation::Payment.def()
}
}
impl Related<super::rental::Entity> for Entity {
fn to() -> RelationDef {
Relation::Rental.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<String>,
pub release_year: Option<String>,
pub language_id: String,
pub original_language_id: Option<String>,
pub rental_duration: String,
pub rental_rate: Decimal,
pub length: Option<String>,
pub replacement_cost: Decimal,
pub rating: Option<String>,
pub special_features: Option<String>,
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<super::film_actor::Entity> for Entity {
fn to() -> RelationDef {
Relation::FilmActor.def()
}
}
impl Related<super::film_category::Entity> for Entity {
fn to() -> RelationDef {
Relation::FilmCategory.def()
}
}
impl Related<super::inventory::Entity> for Entity {
fn to() -> RelationDef {
Relation::Inventory.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<super::film::Entity> for Entity {
fn to() -> RelationDef {
Relation::Film.def()
}
}
impl Related<super::actor::Entity> for Entity {
fn to() -> RelationDef {
Relation::Actor.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<super::category::Entity> for Entity {
fn to() -> RelationDef {
Relation::Category.def()
}
}
impl Related<super::film::Entity> for Entity {
fn to() -> RelationDef {
Relation::Film.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

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

View File

@ -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<super::film::Entity> for Entity {
fn to() -> RelationDef {
Relation::Film.def()
}
}
impl Related<super::store::Entity> for Entity {
fn to() -> RelationDef {
Relation::Store.def()
}
}
impl Related<super::rental::Entity> for Entity {
fn to() -> RelationDef {
Relation::Rental.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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 {}

View File

@ -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;

View File

@ -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<i32>,
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<super::staff::Entity> for Entity {
fn to() -> RelationDef {
Relation::Staff.def()
}
}
impl Related<super::customer::Entity> for Entity {
fn to() -> RelationDef {
Relation::Customer.def()
}
}
impl Related<super::rental::Entity> for Entity {
fn to() -> RelationDef {
Relation::Rental.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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;

View File

@ -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<DateTime>,
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<super::customer::Entity> for Entity {
fn to() -> RelationDef {
Relation::Customer.def()
}
}
impl Related<super::inventory::Entity> for Entity {
fn to() -> RelationDef {
Relation::Inventory.def()
}
}
impl Related<super::staff::Entity> for Entity {
fn to() -> RelationDef {
Relation::Staff.def()
}
}
impl Related<super::payment::Entity> for Entity {
fn to() -> RelationDef {
Relation::Payment.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<String>,
pub email: Option<String>,
pub store_id: i32,
pub active: String,
pub username: String,
pub password: Option<String>,
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<super::address::Entity> for Entity {
fn to() -> RelationDef {
Relation::Address.def()
}
}
impl Related<super::store::Entity> for Entity {
fn to() -> RelationDef {
Relation::Store.def()
}
}
impl Related<super::payment::Entity> for Entity {
fn to() -> RelationDef {
Relation::Payment.def()
}
}
impl Related<super::rental::Entity> for Entity {
fn to() -> RelationDef {
Relation::Rental.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -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<super::address::Entity> for Entity {
fn to() -> RelationDef {
Relation::Address.def()
}
}
impl Related<super::staff::Entity> for Entity {
fn to() -> RelationDef {
Relation::Staff.def()
}
}
impl Related<super::customer::Entity> for Entity {
fn to() -> RelationDef {
Relation::Customer.def()
}
}
impl Related<super::inventory::Entity> for Entity {
fn to() -> RelationDef {
Relation::Inventory.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,4 +0,0 @@
mod compact;
mod expanded;
pub fn main() {}