Rename columns
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
-- https://www.phpmyadmin.net/
|
||||
--
|
||||
-- Host: localhost
|
||||
-- Generation Time: Jan 27, 2026 at 04:31 PM
|
||||
-- Generation Time: Jan 27, 2026 at 05:18 PM
|
||||
-- Server version: 12.1.2-MariaDB
|
||||
-- PHP Version: 8.5.2
|
||||
|
||||
@@ -33,7 +33,7 @@ CREATE TABLE `games` (
|
||||
`official` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`verified` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`developer` varchar(32) DEFAULT NULL,
|
||||
`subcategoryNames` text NOT NULL DEFAULT '{}'
|
||||
`categoryNames` text NOT NULL DEFAULT '\'{}\''
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
@@ -60,7 +60,7 @@ CREATE TABLE `launcherupdates` (
|
||||
|
||||
CREATE TABLE `launcherversionmanifest` (
|
||||
`id` varchar(24) NOT NULL,
|
||||
`versionName` text NOT NULL,
|
||||
`displayName` text NOT NULL,
|
||||
`releaseDate` bigint(20) NOT NULL,
|
||||
`downloadUrls` text NOT NULL,
|
||||
`platforms` text NOT NULL,
|
||||
@@ -71,7 +71,7 @@ CREATE TABLE `launcherversionmanifest` (
|
||||
`sha512sums` text NOT NULL DEFAULT '[]',
|
||||
`sizes` text NOT NULL DEFAULT '\'[]\'',
|
||||
`changelog` text DEFAULT NULL,
|
||||
`subcategory` int(11) NOT NULL DEFAULT -1,
|
||||
`category` int(11) NOT NULL DEFAULT -1,
|
||||
`lastRevision` bigint(20) NOT NULL DEFAULT 0
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPRESSED;
|
||||
|
||||
|
||||
@@ -45,12 +45,12 @@ export const games = mysqlTable('games', {
|
||||
official: boolean('official').default(false).notNull(),
|
||||
verified: boolean('verified').default(false).notNull(),
|
||||
developer: varchar('developer', { length: 32 }),
|
||||
subcategoryNames: text('subcategoryNames').default('{}').notNull()
|
||||
categoryNames: text('categoryNames').default('{}').notNull()
|
||||
})
|
||||
|
||||
export const launcherVersionManifest = mysqlTable('launcherversionmanifest', {
|
||||
id: varchar('id', { length: 24 }).primaryKey().notNull(),
|
||||
versionName: text('versionName').notNull(),
|
||||
displayName: text('displayName').notNull(),
|
||||
releaseDate: bigint('releaseDate', { mode: 'number' }).notNull(),
|
||||
downloadUrls: text('downloadUrls').notNull(),
|
||||
platforms: text('platforms').notNull(),
|
||||
@@ -64,7 +64,7 @@ export const launcherVersionManifest = mysqlTable('launcherversionmanifest', {
|
||||
sha512sums: text('sha512sums').default('[]').notNull(),
|
||||
sizes: text('sizes').default('[]').notNull(),
|
||||
changelog: text('changelog'),
|
||||
subcategory: int('subcategory').notNull().default(-1),
|
||||
category: int('category').notNull().default(-1),
|
||||
lastRevision: bigint('lastRevision', { mode: 'number' }).notNull().default(0)
|
||||
})
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ export async function handler (context: Context) {
|
||||
const versionsRaw = await db
|
||||
.select({
|
||||
id: launcherVersionManifest.id,
|
||||
versionName: launcherVersionManifest.versionName,
|
||||
displayName: launcherVersionManifest.displayName,
|
||||
releaseDate: launcherVersionManifest.releaseDate,
|
||||
game: launcherVersionManifest.game,
|
||||
downloadUrls: launcherVersionManifest.downloadUrls,
|
||||
@@ -83,7 +83,7 @@ export async function handler (context: Context) {
|
||||
sizes: launcherVersionManifest.sizes,
|
||||
place: launcherVersionManifest.place,
|
||||
changelog: launcherVersionManifest.changelog,
|
||||
subcategory: launcherVersionManifest.subcategory,
|
||||
category: launcherVersionManifest.category,
|
||||
lastRevision: launcherVersionManifest.lastRevision
|
||||
})
|
||||
.from(launcherVersionManifest)
|
||||
@@ -153,7 +153,7 @@ export async function handler (context: Context) {
|
||||
|
||||
const gamesList = gamesListRaw.map(v => ({
|
||||
...v,
|
||||
subcategoryNames: JSON.parse(v.subcategoryNames)
|
||||
categoryNames: JSON.parse(v.categoryNames)
|
||||
}))
|
||||
|
||||
connection.end()
|
||||
|
||||
Reference in New Issue
Block a user