Skip to content

Commit 939b9eb

Browse files
committed
Changed persistent sessions id to BIGSERIAL.
1 parent 0022106 commit 939b9eb

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

migrations/2022-02-21-211645_create_sessions/up.sql

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
CREATE TABLE persistent_sessions
22
(
3-
id SERIAL
4-
CONSTRAINT persistent_sessions_pk
5-
PRIMARY KEY,
3+
id BIGSERIAL
4+
CONSTRAINT persistent_sessions_pk
5+
PRIMARY KEY,
66
user_id INTEGER NOT NULL,
77
hashed_token bytea NOT NULL,
88
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,

src/models/persistent_session.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use crate::util::token::SecureTokenKind;
1818
#[table_name = "persistent_sessions"]
1919
pub struct PersistentSession {
2020
/// The id of this session.
21-
pub id: i32,
21+
pub id: i64,
2222
/// The user id associated with this session.
2323
pub user_id: i32,
2424
/// The token (hashed) that identifies the session.

src/schema.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -608,10 +608,10 @@ table! {
608608
persistent_sessions (id) {
609609
/// The `id` column of the `persistent_sessions` table.
610610
///
611-
/// Its SQL type is `Int4`.
611+
/// Its SQL type is `Int8`.
612612
///
613613
/// (Automatically generated by Diesel.)
614-
id -> Int4,
614+
id -> Int8,
615615
/// The `user_id` column of the `persistent_sessions` table.
616616
///
617617
/// Its SQL type is `Int4`.

0 commit comments

Comments
 (0)