diff --git a/src/tests_cfg/cake.rs b/src/tests_cfg/cake.rs index 920e1fea..90f529a5 100644 --- a/src/tests_cfg/cake.rs +++ b/src/tests_cfg/cake.rs @@ -6,6 +6,7 @@ use crate::entity::prelude::*; pub struct Model { #[sea_orm(primary_key)] pub id: i32, + #[sea_orm(column_name = "name", enum_name = "Name")] pub name: String, } diff --git a/tests/common/bakery_chain/metadata.rs b/tests/common/bakery_chain/metadata.rs index 95a7a48b..0811ce39 100644 --- a/tests/common/bakery_chain/metadata.rs +++ b/tests/common/bakery_chain/metadata.rs @@ -5,6 +5,8 @@ use sea_orm::entity::prelude::*; pub struct Model { #[sea_orm(primary_key, auto_increment = false)] pub uuid: Uuid, + #[sea_orm(column_name = "type", enum_name = "Type")] + pub ty: String, pub key: String, pub value: String, pub bytes: Vec, diff --git a/tests/common/setup/schema.rs b/tests/common/setup/schema.rs index 64f31dfe..176cfc70 100644 --- a/tests/common/setup/schema.rs +++ b/tests/common/setup/schema.rs @@ -283,6 +283,7 @@ pub async fn create_metadata_table(db: &DbConn) -> Result { .not_null() .primary_key(), ) + .col(ColumnDef::new(metadata::Column::Type).string().not_null()) .col(ColumnDef::new(metadata::Column::Key).string().not_null()) .col(ColumnDef::new(metadata::Column::Value).string().not_null()) .col(ColumnDef::new(metadata::Column::Bytes).binary().not_null()) diff --git a/tests/parallel_tests.rs b/tests/parallel_tests.rs index 0ac09fd6..7b313d0c 100644 --- a/tests/parallel_tests.rs +++ b/tests/parallel_tests.rs @@ -22,18 +22,21 @@ pub async fn crud_in_parallel(db: &DatabaseConnection) -> Result<(), DbErr> { let metadata = vec![ metadata::Model { uuid: Uuid::new_v4(), + ty: "Type".to_owned(), key: "markup".to_owned(), value: "1.18".to_owned(), bytes: vec![1, 2, 3], }, metadata::Model { uuid: Uuid::new_v4(), + ty: "Type".to_owned(), key: "exchange_rate".to_owned(), value: "0.78".to_owned(), bytes: vec![1, 2, 3], }, metadata::Model { uuid: Uuid::new_v4(), + ty: "Type".to_owned(), key: "service_charge".to_owned(), value: "1.1".to_owned(), bytes: vec![1, 2, 3], diff --git a/tests/uuid_tests.rs b/tests/uuid_tests.rs index e58daca4..2bd83473 100644 --- a/tests/uuid_tests.rs +++ b/tests/uuid_tests.rs @@ -20,6 +20,7 @@ async fn main() -> Result<(), DbErr> { pub async fn create_metadata(db: &DatabaseConnection) -> Result<(), DbErr> { let metadata = metadata::Model { uuid: Uuid::new_v4(), + ty: "Type".to_owned(), key: "markup".to_owned(), value: "1.18".to_owned(), bytes: vec![1, 2, 3],