chore: admin - created_at, update_at

This commit is contained in:
Sebastian Pravda 2022-10-24 11:58:01 +02:00
parent 9a00d053bd
commit a5982a3231
No known key found for this signature in database
GPG key ID: F3BC84F08EFA3F57
2 changed files with 6 additions and 0 deletions

View file

@ -12,6 +12,8 @@ pub struct Model {
#[sea_orm(column_type = "Text")]
pub private_key_hash: String,
pub password_hash: String,
pub created_at: DateTime,
pub updated_at: DateTime,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]

View file

@ -22,6 +22,8 @@ impl MigrationTrait for Migration {
.col(ColumnDef::new(Admin::PublicKey).string().not_null())
.col(ColumnDef::new(Admin::PrivateKeyHash).text().not_null())
.col(ColumnDef::new(Admin::PasswordHash).string().not_null())
.col(ColumnDef::new(Admin::CreatedAt).date_time().not_null())
.col(ColumnDef::new(Admin::UpdatedAt).date_time().not_null())
.to_owned(),
)
.await
@ -43,4 +45,6 @@ enum Admin {
PublicKey,
PrivateKeyHash,
PasswordHash,
CreatedAt,
UpdatedAt,
}