Actualiza formato del código aplicando cargo fmt

This commit is contained in:
Manuel Cillero 2022-07-20 00:01:01 +02:00
parent 4b5caf06a7
commit e6ea59785e
75 changed files with 1069 additions and 1160 deletions

View file

@ -21,59 +21,39 @@ pub_migration!(Migration);
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager.create_table(Table::create()
.table(User::Table)
.if_not_exists()
.col(ColumnDef::new(User::Uid)
.unsigned()
.not_null()
.primary_key()
manager
.create_table(
Table::create()
.table(User::Table)
.if_not_exists()
.col(
ColumnDef::new(User::Uid)
.unsigned()
.not_null()
.primary_key(),
)
.col(
ColumnDef::new(User::Name)
.string_len(60)
.not_null()
.unique_key(),
)
.col(ColumnDef::new(User::Pass).string_len(128).not_null())
.col(ColumnDef::new(User::Mail).string_len(255))
.col(ColumnDef::new(User::Created).timestamp().not_null())
.col(ColumnDef::new(User::Changed).timestamp().not_null())
.col(ColumnDef::new(User::Access).timestamp().not_null())
.col(ColumnDef::new(User::Login).timestamp().not_null())
.col(ColumnDef::new(User::Status).boolean().not_null())
.col(ColumnDef::new(User::Timezone).string_len(32))
.to_owned(),
)
.col(ColumnDef::new(User::Name)
.string_len(60)
.not_null()
.unique_key()
)
.col(ColumnDef::new(User::Pass)
.string_len(128)
.not_null()
)
.col(ColumnDef::new(User::Mail)
.string_len(255)
)
.col(ColumnDef::new(User::Created)
.timestamp()
.not_null()
)
.col(ColumnDef::new(User::Changed)
.timestamp()
.not_null()
)
.col(ColumnDef::new(User::Access)
.timestamp()
.not_null()
)
.col(ColumnDef::new(User::Login)
.timestamp()
.not_null()
)
.col(ColumnDef::new(User::Status)
.boolean()
.not_null()
)
.col(ColumnDef::new(User::Timezone)
.string_len(32)
)
.to_owned()
)
.await
.await
}
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager.drop_table(Table::drop()
.table(User::Table)
.to_owned()
)
.await
manager
.drop_table(Table::drop().table(User::Table).to_owned())
.await
}
}