1
0
Fork 0
forked from alemi/upub

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) .table(Sessions::Table)
.col( .col(
ColumnDef::new(Sessions::Id) ColumnDef::new(Sessions::Id)
.integer() .string()
.not_null() .not_null()
.auto_increment()
.primary_key() .primary_key()
) )
.col(ColumnDef::new(Sessions::Actor).string().not_null()) .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()) .col(ColumnDef::new(Sessions::Expires).date_time().not_null())
.to_owned() .to_owned()
) )
@ -63,8 +61,7 @@ enum Credentials {
#[derive(DeriveIden)] #[derive(DeriveIden)]
enum Sessions { enum Sessions {
Table, 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, Actor,
Session,
Expires, Expires,
} }

View file

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