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/
--
-- 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
-- PHP Version: 8.3.30
@@ -58,13 +58,11 @@ CREATE TABLE `games` (
--
CREATE TABLE `launcherupdates` (
`id` varchar(24) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`releaseDate` bigint(20) NOT NULL,
`downloadUrls` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`platforms` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`hidden` tinyint(1) NOT NULL DEFAULT 1,
`place` bigint(20) NOT NULL DEFAULT 0,
`sha512sums` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '[]'
`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;
-- --------------------------------------------------------
@@ -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`
--
@@ -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`
--
@@ -224,12 +195,6 @@ ALTER TABLE `launcherversionmanifest`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_game` (`game`);
--
-- Indexes for table `loaderupdates`
--
ALTER TABLE `loaderupdates`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `mods`
--
@@ -255,12 +220,6 @@ ALTER TABLE `resetcodes`
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `v2launcherupdates`
--
ALTER TABLE `v2launcherupdates`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `verifycodes`
--
@@ -283,6 +242,12 @@ ALTER TABLE `files`
ALTER TABLE `games`
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`
--
@@ -301,12 +266,6 @@ ALTER TABLE `resetcodes`
ALTER TABLE `users`
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`
--
+1 -19
View File
@@ -25,24 +25,6 @@ export const users = mysqlTable('users', {
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', {
id: bigint('id', { mode: 'number' }).primaryKey().autoincrement().notNull(),
name: text('name').notNull(),
@@ -127,7 +109,7 @@ export const modVersions = mysqlTable('modversions', {
hidden: boolean('hidden').default(false).notNull()
})
export const v2LauncherUpdates = mysqlTable('v2launcherupdates', {
export const launcherUpdates = mysqlTable('launcherupdates', {
id: bigint('id', { mode: 'number' }).primaryKey().autoincrement().notNull(),
version: varchar('version', { length: 32 }).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 {
generateSignature,
@@ -14,10 +14,10 @@ export const handler = async () => {
const version = await db
.select({
version: v2LauncherUpdates.version
version: launcherUpdates.version
})
.from(v2LauncherUpdates)
.orderBy(desc(v2LauncherUpdates.id))
.from(launcherUpdates)
.orderBy(desc(launcherUpdates.id))
.limit(1)
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 { getDatabaseConnection, jsonResponse } from '../../../lib/util'
import { Context } from 'elysia'
@@ -14,13 +14,13 @@ export const handler = async (context: Context) => {
const versionsData = await db
.select({
version: v2LauncherUpdates.version,
notes: v2LauncherUpdates.notes,
releaseDate: v2LauncherUpdates.releaseDate,
downloadData: v2LauncherUpdates.downloadData
version: launcherUpdates.version,
notes: launcherUpdates.notes,
releaseDate: launcherUpdates.releaseDate,
downloadData: launcherUpdates.downloadData
})
.from(v2LauncherUpdates)
.orderBy(desc(v2LauncherUpdates.id))
.from(launcherUpdates)
.orderBy(desc(launcherUpdates.id))
.limit(1)
.execute()