fix: session id is session

This commit is contained in:
əlemi 2024-03-25 01:58:06 +01:00
parent fbd175e8f3
commit 41899556bf
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 3 additions and 7 deletions

View file

@ -28,13 +28,11 @@ impl MigrationTrait for Migration {
.table(Sessions::Table)
.col(
ColumnDef::new(Sessions::Id)
.integer()
.string()
.not_null()
.auto_increment()
.primary_key()
)
.col(ColumnDef::new(Sessions::Actor).string().not_null())
.col(ColumnDef::new(Sessions::Session).string().not_null())
.col(ColumnDef::new(Sessions::Expires).date_time().not_null())
.to_owned()
)
@ -63,8 +61,7 @@ enum Credentials {
#[derive(DeriveIden)]
enum Sessions {
Table,
Id, // TODO here ID is a number but in Credentials it's the actor ID (String) ??? weird!!
Id, // TODO here ID is the session "secret" but in Credentials it's the actor ID (String) ??? weird!!
Actor,
Session,
Expires,
}

View file

@ -4,9 +4,8 @@ use sea_orm::entity::prelude::*;
#[sea_orm(table_name = "sessions")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i64,
pub id: String,
pub actor: String,
pub session: String,
pub expires: ChronoDateTimeUtc,
}