A Deno-powered backend service for Plants vs. Zombies: MODDED. [Read-only GitHub mirror] docs.pvzm.net
express typescript expressjs plant deno jspvz pvzm game online backend plants-vs-zombies zombie javascript plants modded vs plantsvszombies openapi pvz noads
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Format "0.5.2: unify logging data in database, post features on bluesky" Original commit: https://github.com/ROBlNET13/pvzm-backend/commit/dbb466414abb054211d3314c236ec331cb760f2b

Co-authored-by: ClaytonTDM <clay@clay.rip>

+10 -7
+9 -6
modules/db.ts
··· 149 149 150 150 // migrate old flat logging_data format to nested structure 151 151 // old: { "discord": "msg_id" } -> new: { "discord": { "public": "msg_id" } } 152 - const levelsWithOldFormat = db 153 - .prepare("SELECT id, logging_data FROM levels WHERE logging_data IS NOT NULL") 154 - .all() as { id: number; logging_data: string }[]; 152 + const levelsWithOldFormat = db.prepare("SELECT id, logging_data FROM levels WHERE logging_data IS NOT NULL").all() as { 153 + id: number; 154 + logging_data: string; 155 + }[]; 155 156 156 157 let migratedCount = 0; 157 158 for (const level of levelsWithOldFormat) { ··· 181 182 182 183 // migrate old admin_logging_data into unified logging_data structure 183 184 if (tableHasColumn(db, "levels", "admin_logging_data")) { 184 - const levelsToMigrate = db 185 - .prepare("SELECT id, logging_data, admin_logging_data FROM levels WHERE admin_logging_data IS NOT NULL") 186 - .all() as { id: number; logging_data: string | null; admin_logging_data: string | null }[]; 185 + const levelsToMigrate = db.prepare("SELECT id, logging_data, admin_logging_data FROM levels WHERE admin_logging_data IS NOT NULL").all() as { 186 + id: number; 187 + logging_data: string | null; 188 + admin_logging_data: string | null; 189 + }[]; 187 190 188 191 for (const level of levelsToMigrate) { 189 192 try {
+1 -1
modules/routes/admin.ts
··· 104 104 105 105 const { name, author, sun, is_water, difficulty, favorites, plays, featured, featured_at } = req.body; 106 106 107 - // build update query dynamically to only update provided fields 107 + // build update query dynamically to only update provided fields 108 108 const updates: string[] = []; 109 109 const updateParams: any[] = []; 110 110