Merge pull request #1555 from vector-im/feature/bma/fixDbMigrationTest
Feature/bma/fix db migration test
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,3 +1,13 @@
|
||||
--------------------------------------------------------------------
|
||||
-- Current version of the DB is the highest value of filename
|
||||
-- in the folder `sqldelight/databases`.
|
||||
--
|
||||
-- When upgrading the schema, you have to create a file .sqm in the
|
||||
-- `sqldelight/databases` folder and run the following task to
|
||||
-- generate a .db file using the latest schema
|
||||
-- > ./gradlew generateDebugSessionDatabaseSchema
|
||||
--------------------------------------------------------------------
|
||||
|
||||
CREATE TABLE SessionData (
|
||||
userId TEXT NOT NULL PRIMARY KEY,
|
||||
deviceId TEXT NOT NULL,
|
||||
@@ -5,9 +15,12 @@ CREATE TABLE SessionData (
|
||||
refreshToken TEXT,
|
||||
homeserverUrl TEXT NOT NULL,
|
||||
slidingSyncProxy TEXT,
|
||||
-- added in version 2
|
||||
loginTimestamp INTEGER,
|
||||
-- added in version 3
|
||||
oidcData TEXT,
|
||||
isTokenValid INTEGER NOT NULL,
|
||||
-- added in version 4
|
||||
isTokenValid INTEGER NOT NULL DEFAULT 1,
|
||||
loginType TEXT
|
||||
);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
-- Migrate DB from version 1
|
||||
|
||||
ALTER TABLE SessionData ADD COLUMN loginTimestamp INTEGER;
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
-- Migrate DB from version 2
|
||||
|
||||
ALTER TABLE SessionData ADD COLUMN oidcData TEXT;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user