From 41899556bf53a6d410b13d5cd26d917dbe38617a Mon Sep 17 00:00:00 2001 From: alemi Date: Mon, 25 Mar 2024 01:58:06 +0100 Subject: [PATCH] fix: session id is session --- src/migrations/m20240323_000002_add_simple_credentials.rs | 7 ++----- src/model/session.rs | 3 +-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/migrations/m20240323_000002_add_simple_credentials.rs b/src/migrations/m20240323_000002_add_simple_credentials.rs index d112a56..4600716 100644 --- a/src/migrations/m20240323_000002_add_simple_credentials.rs +++ b/src/migrations/m20240323_000002_add_simple_credentials.rs @@ -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, } diff --git a/src/model/session.rs b/src/model/session.rs index 598a638..a2216e2 100644 --- a/src/model/session.rs +++ b/src/model/session.rs @@ -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, }