From 0f6ec77dc00647e0a765182a2ba6f30b8869c8c2 Mon Sep 17 00:00:00 2001 From: Thanu Poptiphueng Date: Sat, 18 May 2024 09:40:43 +0700 Subject: [PATCH] update to wal mode --- Taskfile.yml | 3 +++ initialData.ts | 5 ++++- src/db.ts | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Taskfile.yml b/Taskfile.yml index 6368d47..778bb14 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -24,3 +24,6 @@ tasks: - node -r @swc-node/register src/app.ts env: NODE_ENV: production + update-server: + cmds: + - ssh -t sorvor-p "docker compose pull && docker compose up -d" diff --git a/initialData.ts b/initialData.ts index c6d07b0..3545638 100644 --- a/initialData.ts +++ b/initialData.ts @@ -21,7 +21,10 @@ export const Groups = [ "กลุ่มอื่นๆ", ]; -export const Opinions: { name: string; choicemode: "3Choice" | "4Choice" }[] = [ +export const Opinions: { + name: string; + choicemode: "3Choice" | "4Choice" | "5Choice"; +}[] = [ { name: "สว. มีอำนาจโหวตเลือกนายกรัฐมนตรี", choicemode: "3Choice" }, { name: "แก้ไขรัฐธรรมนูญ 2560", choicemode: "3Choice" }, { name: "เขียนรัฐธรรมนูญใหม่ “ทั้งฉบับ”", choicemode: "3Choice" }, diff --git a/src/db.ts b/src/db.ts index f4aab1d..5c3aa74 100644 --- a/src/db.ts +++ b/src/db.ts @@ -4,5 +4,6 @@ import Database from "better-sqlite3"; import * as schema from "./schema"; const sqlite = new Database("sqlite.db"); +sqlite.pragma("journal_mode = WAL"); export const db = drizzle(sqlite, { schema }); migrate(db, { migrationsFolder: "drizzle" });