(
db: &DbConn,
create: &TableCreateStatement,
)
| 143 | } |
| 144 | |
| 145 | pub async fn create_table_without_asserts( |
| 146 | db: &DbConn, |
| 147 | create: &TableCreateStatement, |
| 148 | ) -> Result<ExecResult, DbErr> { |
| 149 | let builder = db.get_database_backend(); |
| 150 | if builder != DbBackend::Sqlite { |
| 151 | let stmt = builder.build( |
| 152 | Table::drop() |
| 153 | .table(create.get_table_name().unwrap().clone()) |
| 154 | .if_exists() |
| 155 | .cascade(), |
| 156 | ); |
| 157 | db.execute(stmt).await?; |
| 158 | } |
| 159 | db.execute(builder.build(create)).await |
| 160 | } |
| 161 | |
| 162 | pub fn rust_dec<T: ToString>(v: T) -> rust_decimal::Decimal { |
| 163 | use std::str::FromStr; |
no test coverage detected