Add a option for me to hide launcher versions and update db
This commit is contained in:
40
database.sql
40
database.sql
@@ -3,7 +3,7 @@
|
|||||||
-- https://www.phpmyadmin.net/
|
-- https://www.phpmyadmin.net/
|
||||||
--
|
--
|
||||||
-- Host: 127.0.0.1:3306
|
-- Host: 127.0.0.1:3306
|
||||||
-- Generation Time: Aug 28, 2025 at 08:21 PM
|
-- Generation Time: Sep 12, 2025 at 07:45 PM
|
||||||
-- Server version: 11.8.3-MariaDB-ubu2404
|
-- Server version: 11.8.3-MariaDB-ubu2404
|
||||||
-- PHP Version: 8.1.33
|
-- PHP Version: 8.1.33
|
||||||
|
|
||||||
@@ -62,7 +62,8 @@ CREATE TABLE `launcherversions` (
|
|||||||
`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,
|
||||||
`executables` text NOT NULL
|
`executables` text NOT NULL,
|
||||||
|
`hidden` tinyint(1) NOT NULL DEFAULT 1
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPRESSED;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPRESSED;
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
@@ -85,6 +86,22 @@ CREATE TABLE `marketplaceicons` (
|
|||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `userposts`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `userposts` (
|
||||||
|
`id` int(11) NOT NULL,
|
||||||
|
`userId` int(11) NOT NULL,
|
||||||
|
`content` text NOT NULL,
|
||||||
|
`timestamp` int(11) NOT NULL,
|
||||||
|
`likes` bigint(20) NOT NULL DEFAULT 0,
|
||||||
|
`deleted_at` int(11) NOT NULL DEFAULT 0,
|
||||||
|
`votes` text NOT NULL DEFAULT '[]'
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `users`
|
-- Table structure for table `users`
|
||||||
--
|
--
|
||||||
@@ -135,6 +152,13 @@ ALTER TABLE `marketplaceicons`
|
|||||||
ADD PRIMARY KEY (`id`),
|
ADD PRIMARY KEY (`id`),
|
||||||
ADD KEY `fk_userId` (`userId`);
|
ADD KEY `fk_userId` (`userId`);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Indexes for table `userposts`
|
||||||
|
--
|
||||||
|
ALTER TABLE `userposts`
|
||||||
|
ADD PRIMARY KEY (`id`),
|
||||||
|
ADD KEY `fk_userposts_userId` (`userId`);
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Indexes for table `users`
|
-- Indexes for table `users`
|
||||||
--
|
--
|
||||||
@@ -169,6 +193,12 @@ ALTER TABLE `launcherversions`
|
|||||||
ALTER TABLE `marketplaceicons`
|
ALTER TABLE `marketplaceicons`
|
||||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- AUTO_INCREMENT for table `userposts`
|
||||||
|
--
|
||||||
|
ALTER TABLE `userposts`
|
||||||
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- AUTO_INCREMENT for table `users`
|
-- AUTO_INCREMENT for table `users`
|
||||||
--
|
--
|
||||||
@@ -197,6 +227,12 @@ ALTER TABLE `chats`
|
|||||||
--
|
--
|
||||||
ALTER TABLE `marketplaceicons`
|
ALTER TABLE `marketplaceicons`
|
||||||
ADD CONSTRAINT `fk_marketplaceicons_userId` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
ADD CONSTRAINT `fk_marketplaceicons_userId` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Constraints for table `userposts`
|
||||||
|
--
|
||||||
|
ALTER TABLE `userposts`
|
||||||
|
ADD CONSTRAINT `fk_userposts_userId` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ require __DIR__ . '/../../incl/util.php';
|
|||||||
setJsonHeader();
|
setJsonHeader();
|
||||||
$conn = newConnection();
|
$conn = newConnection();
|
||||||
|
|
||||||
$stmt = $conn->prepare("SELECT * FROM launcherversions ORDER BY id DESC");
|
$stmt = $conn->prepare("SELECT * FROM launcherversions WHERE hidden = 0 ORDER BY id DESC");
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
|
|
||||||
$result = $stmt->get_result();
|
$result = $stmt->get_result();
|
||||||
|
|||||||
Reference in New Issue
Block a user