Refactoring

This commit is contained in:
Billy Chan 2021-11-03 10:56:06 +08:00
parent 0bbb50b7f6
commit 2f7c9ccda7
No known key found for this signature in database
GPG Key ID: A2D690CAC7DF3CC7
2 changed files with 6 additions and 7 deletions

View File

@ -1,7 +1,7 @@
pub use super::super::bakery_chain::*;
use super::*;
use crate::common::setup::{create_table, create_enum, create_table_without_asserts};
use crate::common::setup::{create_enum, create_table, create_table_without_asserts};
use sea_orm::{
error::*, sea_query, ConnectionTrait, DatabaseConnection, DbBackend, DbConn, ExecResult,
};

View File

@ -108,11 +108,10 @@ where
}
let expect_stmts: Vec<Statement> = creates.iter().map(|stmt| builder.build(stmt)).collect();
let create_from_entity_stmts: Vec<Statement> =
Schema::create_enum_from_entity(entity, db.get_database_backend())
.iter()
.map(|stmt| builder.build(stmt))
.collect();
let create_from_entity_stmts: Vec<Statement> = Schema::create_enum_from_entity(entity, builder)
.iter()
.map(|stmt| builder.build(stmt))
.collect();
assert_eq!(expect_stmts, create_from_entity_stmts);
@ -133,7 +132,7 @@ where
{
let builder = db.get_database_backend();
assert_eq!(
builder.build(&Schema::create_table_from_entity(entity)),
builder.build(&Schema::create_table_from_entity(entity, builder)),
builder.build(create)
);