Add some comment in the files manipulating the session DB

This commit is contained in:
Benoit Marty 2023-10-12 14:59:06 +02:00
parent 9bacf9df8e
commit 30b509456c
5 changed files with 16 additions and 0 deletions

View file

@ -1,3 +1,7 @@
------------------------------------
-- Current version of the DB: 4 --
------------------------------------
CREATE TABLE SessionData (
userId TEXT NOT NULL PRIMARY KEY,
deviceId TEXT NOT NULL,
@ -5,8 +9,11 @@ CREATE TABLE SessionData (
refreshToken TEXT,
homeserverUrl TEXT NOT NULL,
slidingSyncProxy TEXT,
-- added in version 2
loginTimestamp INTEGER,
-- added in version 3
oidcData TEXT,
-- added in version 4
isTokenValid INTEGER NOT NULL DEFAULT 1,
loginType TEXT
);

View file

@ -1,3 +1,6 @@
-- This file is not striclty necessary, since the first
-- version of the DB is 1, so we will never migrate from 0
CREATE TABLE SessionData (
userId TEXT NOT NULL PRIMARY KEY,
deviceId TEXT NOT NULL,

View file

@ -1 +1,3 @@
-- Migrate DB from version 1
ALTER TABLE SessionData ADD COLUMN loginTimestamp INTEGER;

View file

@ -1 +1,3 @@
-- Migrate DB from version 2
ALTER TABLE SessionData ADD COLUMN oidcData TEXT;

View file

@ -1,2 +1,4 @@
-- Migrate DB from version 3
ALTER TABLE SessionData ADD COLUMN isTokenValid INTEGER NOT NULL DEFAULT 1;
ALTER TABLE SessionData ADD COLUMN loginType TEXT;