From 8312c20d5d352c5599e58dbdf41106aa047234a0 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Wed, 18 Jan 2023 21:23:26 +0000 Subject: [PATCH] Add table for client side extra room metadata --- .../sqldelight/app/dapk/db/migration/2.sqm | 5 +++++ .../sqldelight/app/dapk/db/model/BubbleRoom.sq | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 domains/store/src/main/sqldelight/app/dapk/db/migration/2.sqm create mode 100644 domains/store/src/main/sqldelight/app/dapk/db/model/BubbleRoom.sq diff --git a/domains/store/src/main/sqldelight/app/dapk/db/migration/2.sqm b/domains/store/src/main/sqldelight/app/dapk/db/migration/2.sqm new file mode 100644 index 0000000..f4ee11d --- /dev/null +++ b/domains/store/src/main/sqldelight/app/dapk/db/migration/2.sqm @@ -0,0 +1,5 @@ +CREATE TABLE IF NOT EXISTS dbStRoomMeta ( + room_id TEXT NOT NULL, + is_bubble INTEGER AS Int NOT NULL DEFAULT 0, + PRIMARY KEY (room_id) +); \ No newline at end of file diff --git a/domains/store/src/main/sqldelight/app/dapk/db/model/BubbleRoom.sq b/domains/store/src/main/sqldelight/app/dapk/db/model/BubbleRoom.sq new file mode 100644 index 0000000..b936524 --- /dev/null +++ b/domains/store/src/main/sqldelight/app/dapk/db/model/BubbleRoom.sq @@ -0,0 +1,18 @@ +CREATE TABLE dbStRoomMeta ( + room_id TEXT NOT NULL, + is_bubble INTEGER AS Int NOT NULL DEFAULT 0, + PRIMARY KEY (room_id) +); + +markBubble: +INSERT OR REPLACE INTO dbStRoomMeta(room_id, is_bubble) +VALUES (?,?); + +unmarkBubble: +INSERT OR REPLACE INTO dbStRoomMeta(room_id, is_bubble) +VALUES (?,?); + +select: +SELECT is_bubble +FROM dbStRoomMeta +WHERE room_id = ?;