Android build v1.0.43
This commit is contained in:
+8
-1
@@ -1,4 +1,4 @@
|
||||
import { mkdirSync } from 'node:fs'
|
||||
import { existsSync, mkdirSync } from 'node:fs'
|
||||
import { readFile } from 'node:fs/promises'
|
||||
import { DatabaseSync } from 'node:sqlite'
|
||||
|
||||
@@ -7,6 +7,7 @@ mkdirSync('data', { recursive: true })
|
||||
const database = new DatabaseSync('data/game.db')
|
||||
const schema = await readFile(new URL('../db/schema.sql', import.meta.url), 'utf8')
|
||||
const seed = await readFile(new URL('../db/seed.sql', import.meta.url), 'utf8')
|
||||
const adminOverridesUrl = new URL('../db/admin-overrides.sql', import.meta.url)
|
||||
|
||||
database.exec(schema)
|
||||
|
||||
@@ -205,6 +206,7 @@ addColumnIfMissing('dungeons', 'content_type', "TEXT NOT NULL DEFAULT 'dungeon'"
|
||||
addColumnIfMissing('dungeons', 'party_size', 'INTEGER NOT NULL DEFAULT 5')
|
||||
addColumnIfMissing('dungeons', 'completion_item_level', 'INTEGER')
|
||||
addColumnIfMissing('dungeons', 'experience_reward', 'INTEGER NOT NULL DEFAULT 100')
|
||||
addColumnIfMissing('dungeons', 'image_url', "TEXT NOT NULL DEFAULT '/boss-placeholder.svg'")
|
||||
addColumnIfMissing('classes', 'theme_color', "TEXT NOT NULL DEFAULT '#e5b95f'")
|
||||
addColumnIfMissing('spells', 'unlock_level', 'INTEGER NOT NULL DEFAULT 1')
|
||||
addColumnIfMissing('spells', 'glyph', "TEXT NOT NULL DEFAULT '+'")
|
||||
@@ -249,6 +251,11 @@ addColumnIfMissing('items', 'image_url', "TEXT NOT NULL DEFAULT '/equipment-plac
|
||||
|
||||
database.exec(seed)
|
||||
|
||||
if (existsSync(adminOverridesUrl)) {
|
||||
const adminOverrides = await readFile(adminOverridesUrl, 'utf8')
|
||||
database.exec(adminOverrides)
|
||||
}
|
||||
|
||||
const counts = database
|
||||
.prepare(`
|
||||
SELECT
|
||||
|
||||
Reference in New Issue
Block a user