Remove legacy launcher tables

This commit is contained in:
Lncvrt committed 2026-04-19 15:04:12 -07:00
1 parent 626fc4e6df
commit b35f0da493
4 files changed
+24 -83

No files matched your search

+12 -53
View File
@@ -3,7 +3,7 @@
-- https://www.phpmyadmin.net/ -- https://www.phpmyadmin.net/
-- --
-- Host: localhost -- Host: localhost
-- Generation Time: Apr 03, 2026 at 12:13 AM -- Generation Time: Apr 19, 2026 at 10:03 PM
-- Server version: 10.11.14-MariaDB-0ubuntu0.24.04.1 -- Server version: 10.11.14-MariaDB-0ubuntu0.24.04.1
-- PHP Version: 8.3.30 -- PHP Version: 8.3.30
@@ -58,13 +58,11 @@ CREATE TABLE `games` (
-- --
CREATE TABLE `launcherupdates` ( CREATE TABLE `launcherupdates` (
`id` varchar(24) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, `id` bigint(20) NOT NULL,
`releaseDate` bigint(20) NOT NULL, `version` varchar(32) NOT NULL,
`downloadUrls` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, `notes` text NOT NULL,
`platforms` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, `release_date` timestamp NOT NULL,
`hidden` tinyint(1) NOT NULL DEFAULT 1, `download_data` text NOT NULL
`place` bigint(20) NOT NULL DEFAULT 0,
`sha512sums` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '[]'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPRESSED; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPRESSED;
-- -------------------------------------------------------- -- --------------------------------------------------------
@@ -92,19 +90,6 @@ CREATE TABLE `launcherversionmanifest` (
-- -------------------------------------------------------- -- --------------------------------------------------------
--
-- Table structure for table `loaderupdates`
--
CREATE TABLE `loaderupdates` (
`id` varchar(24) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`releaseDate` bigint(20) NOT NULL,
`hidden` tinyint(1) NOT NULL DEFAULT 1,
`place` bigint(20) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPRESSED;
-- --------------------------------------------------------
-- --
-- Table structure for table `mods` -- Table structure for table `mods`
-- --
@@ -169,20 +154,6 @@ CREATE TABLE `users` (
-- -------------------------------------------------------- -- --------------------------------------------------------
--
-- Table structure for table `v2launcherupdates`
--
CREATE TABLE `v2launcherupdates` (
`id` bigint(20) NOT NULL,
`version` varchar(32) NOT NULL,
`notes` text NOT NULL,
`release_date` timestamp NOT NULL,
`download_data` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPRESSED;
-- --------------------------------------------------------
-- --
-- Table structure for table `verifycodes` -- Table structure for table `verifycodes`
-- --
@@ -224,12 +195,6 @@ ALTER TABLE `launcherversionmanifest`
ADD PRIMARY KEY (`id`), ADD PRIMARY KEY (`id`),
ADD KEY `fk_game` (`game`); ADD KEY `fk_game` (`game`);
--
-- Indexes for table `loaderupdates`
--
ALTER TABLE `loaderupdates`
ADD PRIMARY KEY (`id`);
-- --
-- Indexes for table `mods` -- Indexes for table `mods`
-- --
@@ -255,12 +220,6 @@ ALTER TABLE `resetcodes`
ALTER TABLE `users` ALTER TABLE `users`
ADD PRIMARY KEY (`id`); ADD PRIMARY KEY (`id`);
--
-- Indexes for table `v2launcherupdates`
--
ALTER TABLE `v2launcherupdates`
ADD PRIMARY KEY (`id`);
-- --
-- Indexes for table `verifycodes` -- Indexes for table `verifycodes`
-- --
@@ -283,6 +242,12 @@ ALTER TABLE `files`
ALTER TABLE `games` ALTER TABLE `games`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `launcherupdates`
--
ALTER TABLE `launcherupdates`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
-- --
-- AUTO_INCREMENT for table `mods` -- AUTO_INCREMENT for table `mods`
-- --
@@ -301,12 +266,6 @@ ALTER TABLE `resetcodes`
ALTER TABLE `users` ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `v2launcherupdates`
--
ALTER TABLE `v2launcherupdates`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
-- --
-- AUTO_INCREMENT for table `verifycodes` -- AUTO_INCREMENT for table `verifycodes`
-- --
+1 -19
View File
@@ -25,24 +25,6 @@ export const users = mysqlTable('users', {
leaderboardsBanned: boolean('leaderboards_banned').default(false).notNull() leaderboardsBanned: boolean('leaderboards_banned').default(false).notNull()
}) })
export const launcherUpdates = mysqlTable('launcherupdates', {
id: varchar('id', { length: 24 }).primaryKey().notNull(),
releaseDate: bigint('releaseDate', { mode: 'number' }).notNull(),
downloadUrls: text('downloadUrls').notNull(),
platforms: text('platforms').notNull(),
executables: text('executables').notNull(),
hidden: boolean('hidden').default(false).notNull(),
place: bigint('place', { mode: 'number' }).default(0).notNull(),
sha512sums: text('sha512sums').default('[]').notNull()
})
export const loaderUpdates = mysqlTable('loaderupdates', {
id: varchar('id', { length: 24 }).primaryKey().notNull(),
releaseDate: bigint('releaseDate', { mode: 'number' }).notNull(),
hidden: boolean('hidden').default(false).notNull(),
place: bigint('place', { mode: 'number' }).default(0).notNull()
})
export const games = mysqlTable('games', { export const games = mysqlTable('games', {
id: bigint('id', { mode: 'number' }).primaryKey().autoincrement().notNull(), id: bigint('id', { mode: 'number' }).primaryKey().autoincrement().notNull(),
name: text('name').notNull(), name: text('name').notNull(),
@@ -127,7 +109,7 @@ export const modVersions = mysqlTable('modversions', {
hidden: boolean('hidden').default(false).notNull() hidden: boolean('hidden').default(false).notNull()
}) })
export const v2LauncherUpdates = mysqlTable('v2launcherupdates', { export const launcherUpdates = mysqlTable('launcherupdates', {
id: bigint('id', { mode: 'number' }).primaryKey().autoincrement().notNull(), id: bigint('id', { mode: 'number' }).primaryKey().autoincrement().notNull(),
version: varchar('version', { length: 32 }).notNull(), version: varchar('version', { length: 32 }).notNull(),
notes: text('notes').notNull(), notes: text('notes').notNull(),
+4 -4
View File
@@ -1,4 +1,4 @@
import { v2LauncherUpdates } from '../../../lib/tables' import { launcherUpdates } from '../../../lib/tables'
import { desc } from 'drizzle-orm' import { desc } from 'drizzle-orm'
import { import {
generateSignature, generateSignature,
@@ -14,10 +14,10 @@ export const handler = async () => {
const version = await db const version = await db
.select({ .select({
version: v2LauncherUpdates.version version: launcherUpdates.version
}) })
.from(v2LauncherUpdates) .from(launcherUpdates)
.orderBy(desc(v2LauncherUpdates.id)) .orderBy(desc(launcherUpdates.id))
.limit(1) .limit(1)
connection.end() connection.end()
+7 -7
View File
@@ -1,4 +1,4 @@
import { files, v2LauncherUpdates } from '../../../lib/tables' import { files, launcherUpdates } from '../../../lib/tables'
import { desc, eq } from 'drizzle-orm' import { desc, eq } from 'drizzle-orm'
import { getDatabaseConnection, jsonResponse } from '../../../lib/util' import { getDatabaseConnection, jsonResponse } from '../../../lib/util'
import { Context } from 'elysia' import { Context } from 'elysia'
@@ -14,13 +14,13 @@ export const handler = async (context: Context) => {
const versionsData = await db const versionsData = await db
.select({ .select({
version: v2LauncherUpdates.version, version: launcherUpdates.version,
notes: v2LauncherUpdates.notes, notes: launcherUpdates.notes,
releaseDate: v2LauncherUpdates.releaseDate, releaseDate: launcherUpdates.releaseDate,
downloadData: v2LauncherUpdates.downloadData downloadData: launcherUpdates.downloadData
}) })
.from(v2LauncherUpdates) .from(launcherUpdates)
.orderBy(desc(v2LauncherUpdates.id)) .orderBy(desc(launcherUpdates.id))
.limit(1) .limit(1)
.execute() .execute()