Rename columns

This commit is contained in:
2026-01-27 10:18:25 -07:00
parent 9acc71fa13
commit 0fb9e4f888
3 changed files with 10 additions and 10 deletions

View File

@@ -3,7 +3,7 @@
-- https://www.phpmyadmin.net/ -- https://www.phpmyadmin.net/
-- --
-- Host: localhost -- 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 -- Server version: 12.1.2-MariaDB
-- PHP Version: 8.5.2 -- PHP Version: 8.5.2
@@ -33,7 +33,7 @@ CREATE TABLE `games` (
`official` tinyint(1) NOT NULL DEFAULT 0, `official` tinyint(1) NOT NULL DEFAULT 0,
`verified` tinyint(1) NOT NULL DEFAULT 0, `verified` tinyint(1) NOT NULL DEFAULT 0,
`developer` varchar(32) DEFAULT NULL, `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; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;
-- -------------------------------------------------------- -- --------------------------------------------------------
@@ -60,7 +60,7 @@ CREATE TABLE `launcherupdates` (
CREATE TABLE `launcherversionmanifest` ( CREATE TABLE `launcherversionmanifest` (
`id` varchar(24) NOT NULL, `id` varchar(24) NOT NULL,
`versionName` text NOT NULL, `displayName` text NOT NULL,
`releaseDate` bigint(20) NOT NULL, `releaseDate` bigint(20) NOT NULL,
`downloadUrls` text NOT NULL, `downloadUrls` text NOT NULL,
`platforms` text NOT NULL, `platforms` text NOT NULL,
@@ -71,7 +71,7 @@ CREATE TABLE `launcherversionmanifest` (
`sha512sums` text NOT NULL DEFAULT '[]', `sha512sums` text NOT NULL DEFAULT '[]',
`sizes` text NOT NULL DEFAULT '\'[]\'', `sizes` text NOT NULL DEFAULT '\'[]\'',
`changelog` text DEFAULT NULL, `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 `lastRevision` bigint(20) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPRESSED; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPRESSED;

View File

@@ -45,12 +45,12 @@ export const games = mysqlTable('games', {
official: boolean('official').default(false).notNull(), official: boolean('official').default(false).notNull(),
verified: boolean('verified').default(false).notNull(), verified: boolean('verified').default(false).notNull(),
developer: varchar('developer', { length: 32 }), developer: varchar('developer', { length: 32 }),
subcategoryNames: text('subcategoryNames').default('{}').notNull() categoryNames: text('categoryNames').default('{}').notNull()
}) })
export const launcherVersionManifest = mysqlTable('launcherversionmanifest', { export const launcherVersionManifest = mysqlTable('launcherversionmanifest', {
id: varchar('id', { length: 24 }).primaryKey().notNull(), id: varchar('id', { length: 24 }).primaryKey().notNull(),
versionName: text('versionName').notNull(), displayName: text('displayName').notNull(),
releaseDate: bigint('releaseDate', { mode: 'number' }).notNull(), releaseDate: bigint('releaseDate', { mode: 'number' }).notNull(),
downloadUrls: text('downloadUrls').notNull(), downloadUrls: text('downloadUrls').notNull(),
platforms: text('platforms').notNull(), platforms: text('platforms').notNull(),
@@ -64,7 +64,7 @@ export const launcherVersionManifest = mysqlTable('launcherversionmanifest', {
sha512sums: text('sha512sums').default('[]').notNull(), sha512sums: text('sha512sums').default('[]').notNull(),
sizes: text('sizes').default('[]').notNull(), sizes: text('sizes').default('[]').notNull(),
changelog: text('changelog'), changelog: text('changelog'),
subcategory: int('subcategory').notNull().default(-1), category: int('category').notNull().default(-1),
lastRevision: bigint('lastRevision', { mode: 'number' }).notNull().default(0) lastRevision: bigint('lastRevision', { mode: 'number' }).notNull().default(0)
}) })

View File

@@ -73,7 +73,7 @@ export async function handler (context: Context) {
const versionsRaw = await db const versionsRaw = await db
.select({ .select({
id: launcherVersionManifest.id, id: launcherVersionManifest.id,
versionName: launcherVersionManifest.versionName, displayName: launcherVersionManifest.displayName,
releaseDate: launcherVersionManifest.releaseDate, releaseDate: launcherVersionManifest.releaseDate,
game: launcherVersionManifest.game, game: launcherVersionManifest.game,
downloadUrls: launcherVersionManifest.downloadUrls, downloadUrls: launcherVersionManifest.downloadUrls,
@@ -83,7 +83,7 @@ export async function handler (context: Context) {
sizes: launcherVersionManifest.sizes, sizes: launcherVersionManifest.sizes,
place: launcherVersionManifest.place, place: launcherVersionManifest.place,
changelog: launcherVersionManifest.changelog, changelog: launcherVersionManifest.changelog,
subcategory: launcherVersionManifest.subcategory, category: launcherVersionManifest.category,
lastRevision: launcherVersionManifest.lastRevision lastRevision: launcherVersionManifest.lastRevision
}) })
.from(launcherVersionManifest) .from(launcherVersionManifest)
@@ -153,7 +153,7 @@ export async function handler (context: Context) {
const gamesList = gamesListRaw.map(v => ({ const gamesList = gamesListRaw.map(v => ({
...v, ...v,
subcategoryNames: JSON.parse(v.subcategoryNames) categoryNames: JSON.parse(v.categoryNames)
})) }))
connection.end() connection.end()