Add MariaDB support (#156)

* Fixed startup db check

* Relation tables are created automatically for IGDB metadata

* Removed JSON dependency from filters

* Removed JSON searches from Game library queries

* Gaseous now runs without error on MariaDB

* Fixed static database name bug

* Updated docker files and README
This commit is contained in:
Michael Green
2023-10-13 20:59:53 -07:00
committed by GitHub
parent 1ade1922df
commit b0e74a2010
41 changed files with 282 additions and 170 deletions

View File

@@ -3,7 +3,7 @@ CREATE TABLE `AgeRating` (
`Id` bigint NOT NULL,
`Category` int DEFAULT NULL,
`Checksum` varchar(45) DEFAULT NULL,
`ContentDescriptions` json DEFAULT NULL,
`ContentDescriptions` longtext DEFAULT NULL,
`Rating` int DEFAULT NULL,
`RatingCoverUrl` varchar(255) DEFAULT NULL,
`Synopsis` longtext,
@@ -55,7 +55,7 @@ DROP TABLE IF EXISTS `Collection`;
CREATE TABLE `Collection` (
`Id` bigint NOT NULL,
`Checksum` varchar(45) DEFAULT NULL,
`Games` json DEFAULT NULL,
`Games` longtext DEFAULT NULL,
`Name` varchar(255) DEFAULT NULL,
`Slug` varchar(100) DEFAULT NULL,
`CreatedAt` datetime DEFAULT NULL,
@@ -76,17 +76,17 @@ CREATE TABLE `Company` (
`Country` int DEFAULT NULL,
`CreatedAt` datetime DEFAULT NULL,
`Description` longtext,
`Developed` json DEFAULT NULL,
`Developed` longtext DEFAULT NULL,
`Logo` bigint DEFAULT NULL,
`Name` varchar(255) DEFAULT NULL,
`Parent` bigint DEFAULT NULL,
`Published` json DEFAULT NULL,
`Published` longtext DEFAULT NULL,
`Slug` varchar(100) DEFAULT NULL,
`StartDate` datetime DEFAULT NULL,
`StartDateCategory` int DEFAULT NULL,
`UpdatedAt` datetime DEFAULT NULL,
`Url` varchar(255) DEFAULT NULL,
`Websites` json DEFAULT NULL,
`Websites` longtext DEFAULT NULL,
`dateAdded` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
PRIMARY KEY (`Id`)
@@ -129,7 +129,7 @@ CREATE TABLE `ExternalGame` (
`Category` int DEFAULT NULL,
`Checksum` varchar(45) DEFAULT NULL,
`CreatedAt` datetime DEFAULT NULL,
`Countries` json DEFAULT NULL,
`Countries` longtext DEFAULT NULL,
`Game` bigint DEFAULT NULL,
`Media` int DEFAULT NULL,
`Name` varchar(255) DEFAULT NULL,
@@ -149,7 +149,7 @@ CREATE TABLE `Franchise` (
`Checksum` varchar(45) DEFAULT NULL,
`CreatedAt` datetime DEFAULT NULL,
`UpdatedAt` datetime DEFAULT NULL,
`Games` json DEFAULT NULL,
`Games` longtext DEFAULT NULL,
`Name` varchar(255) DEFAULT NULL,
`Slug` varchar(255) DEFAULT NULL,
`Url` varchar(255) DEFAULT NULL,
@@ -161,83 +161,59 @@ CREATE TABLE `Franchise` (
DROP TABLE IF EXISTS `Game`;
CREATE TABLE `Game` (
`Id` bigint NOT NULL,
`AgeRatings` json DEFAULT NULL,
`AgeRatings` longtext DEFAULT NULL,
`AggregatedRating` double DEFAULT NULL,
`AggregatedRatingCount` int DEFAULT NULL,
`AlternativeNames` json DEFAULT NULL,
`Artworks` json DEFAULT NULL,
`Bundles` json DEFAULT NULL,
`AlternativeNames` longtext DEFAULT NULL,
`Artworks` longtext DEFAULT NULL,
`Bundles` longtext DEFAULT NULL,
`Category` int DEFAULT NULL,
`Checksum` varchar(45) DEFAULT NULL,
`Collection` bigint DEFAULT NULL,
`Cover` bigint DEFAULT NULL,
`CreatedAt` datetime DEFAULT NULL,
`Dlcs` json DEFAULT NULL,
`Expansions` json DEFAULT NULL,
`ExternalGames` json DEFAULT NULL,
`Dlcs` longtext DEFAULT NULL,
`Expansions` longtext DEFAULT NULL,
`ExternalGames` longtext DEFAULT NULL,
`FirstReleaseDate` datetime DEFAULT NULL,
`Follows` int DEFAULT NULL,
`Franchise` bigint DEFAULT NULL,
`Franchises` json DEFAULT NULL,
`GameEngines` json DEFAULT NULL,
`GameModes` json DEFAULT NULL,
`Genres` json DEFAULT NULL,
`Franchises` longtext DEFAULT NULL,
`GameEngines` longtext DEFAULT NULL,
`GameModes` longtext DEFAULT NULL,
`Genres` longtext DEFAULT NULL,
`Hypes` int DEFAULT NULL,
`InvolvedCompanies` json DEFAULT NULL,
`Keywords` json DEFAULT NULL,
`MultiplayerModes` json DEFAULT NULL,
`InvolvedCompanies` longtext DEFAULT NULL,
`Keywords` longtext DEFAULT NULL,
`MultiplayerModes` longtext DEFAULT NULL,
`Name` varchar(255) DEFAULT NULL,
`ParentGame` bigint DEFAULT NULL,
`Platforms` json DEFAULT NULL,
`PlayerPerspectives` json DEFAULT NULL,
`Platforms` longtext DEFAULT NULL,
`PlayerPerspectives` longtext DEFAULT NULL,
`Rating` double DEFAULT NULL,
`RatingCount` int DEFAULT NULL,
`ReleaseDates` json DEFAULT NULL,
`Screenshots` json DEFAULT NULL,
`SimilarGames` json DEFAULT NULL,
`ReleaseDates` longtext DEFAULT NULL,
`Screenshots` longtext DEFAULT NULL,
`SimilarGames` longtext DEFAULT NULL,
`Slug` varchar(100) DEFAULT NULL,
`StandaloneExpansions` json DEFAULT NULL,
`StandaloneExpansions` longtext DEFAULT NULL,
`Status` int DEFAULT NULL,
`StoryLine` longtext,
`Summary` longtext,
`Tags` json DEFAULT NULL,
`Themes` json DEFAULT NULL,
`Tags` longtext DEFAULT NULL,
`Themes` longtext DEFAULT NULL,
`TotalRating` double DEFAULT NULL,
`TotalRatingCount` int DEFAULT NULL,
`UpdatedAt` datetime DEFAULT NULL,
`Url` varchar(255) DEFAULT NULL,
`VersionParent` bigint DEFAULT NULL,
`VersionTitle` varchar(100) DEFAULT NULL,
`Videos` json DEFAULT NULL,
`Websites` json DEFAULT NULL,
`Videos` longtext DEFAULT NULL,
`Websites` longtext DEFAULT NULL,
`dateAdded` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
PRIMARY KEY (`Id`),
UNIQUE KEY `Id_UNIQUE` (`Id`),
KEY `Idx_AgeRatings` ((cast(`AgeRatings` as unsigned array))),
KEY `Idx_Genres` ((cast(`Genres` as unsigned array))),
KEY `Idx_alternativeNames` ((cast(`AlternativeNames` as unsigned array))),
KEY `Idx_artworks` ((cast(`Artworks` as unsigned array))),
KEY `Idx_bundles` ((cast(`Bundles` as unsigned array))),
KEY `Idx_dlcs` ((cast(`Dlcs` as unsigned array))),
KEY `Idx_expansions` ((cast(`Expansions` as unsigned array))),
KEY `Idx_ExternalGames` ((cast(`ExternalGames` as unsigned array))),
KEY `Idx_franchises` ((cast(`Franchises` as unsigned array))),
KEY `Idx_Gameengines` ((cast(`GameEngines` as unsigned array))),
KEY `Idx_Gamemodes` ((cast(`GameModes` as unsigned array))),
KEY `Idx_involvedcompanies` ((cast(`InvolvedCompanies` as unsigned array))),
KEY `Idx_keywords` ((cast(`Keywords` as unsigned array))),
KEY `Idx_multiplayermodes` ((cast(`MultiplayerModes` as unsigned array))),
KEY `Idx_Platforms` ((cast(`Platforms` as unsigned array))),
KEY `Idx_playerperspectives` ((cast(`PlayerPerspectives` as unsigned array))),
KEY `Idx_releasedates` ((cast(`ReleaseDates` as unsigned array))),
KEY `Idx_Screenshots` ((cast(`Screenshots` as unsigned array))),
KEY `Idx_similarGames` ((cast(`SimilarGames` as unsigned array))),
KEY `Idx_standaloneexpansions` ((cast(`StandaloneExpansions` as unsigned array))),
KEY `Idx_tags` ((cast(`Tags` as unsigned array))),
KEY `Idx_themes` ((cast(`Themes` as unsigned array))),
KEY `Idx_vIdeos` ((cast(`Videos` as unsigned array))),
KEY `Idx_websites` ((cast(`Websites` as unsigned array)))
UNIQUE KEY `Id_UNIQUE` (`Id`)
);
DROP TABLE IF EXISTS `Games_Roms`;
@@ -251,7 +227,7 @@ CREATE TABLE `Games_Roms` (
`MD5` varchar(100) DEFAULT NULL,
`SHA1` varchar(100) DEFAULT NULL,
`DevelopmentStatus` varchar(100) DEFAULT NULL,
`Flags` json DEFAULT NULL,
`Flags` longtext DEFAULT NULL,
`RomType` int DEFAULT NULL,
`RomTypeMedia` varchar(100) DEFAULT NULL,
`MediaLabel` varchar(100) DEFAULT NULL,
@@ -322,8 +298,8 @@ CREATE TABLE `Platform` (
`Summary` longtext,
`UpdatedAt` datetime DEFAULT NULL,
`Url` varchar(255) DEFAULT NULL,
`Versions` json DEFAULT NULL,
`Websites` json DEFAULT NULL,
`Versions` longtext DEFAULT NULL,
`Websites` longtext DEFAULT NULL,
`dateAdded` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
PRIMARY KEY (`Id`),
@@ -349,7 +325,7 @@ DROP TABLE IF EXISTS `PlatformVersion`;
CREATE TABLE `PlatformVersion` (
`Id` bigint NOT NULL,
`Checksum` varchar(45) DEFAULT NULL,
`Companies` json DEFAULT NULL,
`Companies` longtext DEFAULT NULL,
`Connectivity` longtext,
`CPU` longtext,
`Graphics` longtext,
@@ -360,7 +336,7 @@ CREATE TABLE `PlatformVersion` (
`OS` longtext,
`Output` longtext,
`PlatformLogo` int DEFAULT NULL,
`PlatformVersionReleaseDates` json DEFAULT NULL,
`PlatformVersionReleaseDates` longtext DEFAULT NULL,
`Resolutions` longtext,
`Slug` longtext,
`Sound` longtext,
@@ -445,7 +421,7 @@ CREATE TABLE `Signatures_Roms` (
`MD5` varchar(100) DEFAULT NULL,
`SHA1` varchar(100) DEFAULT NULL,
`DevelopmentStatus` varchar(100) DEFAULT NULL,
`Flags` json DEFAULT NULL,
`Flags` longtext DEFAULT NULL,
`RomType` int DEFAULT NULL,
`RomTypeMedia` varchar(100) DEFAULT NULL,
`MediaLabel` varchar(100) DEFAULT NULL,
@@ -454,8 +430,7 @@ CREATE TABLE `Signatures_Roms` (
UNIQUE KEY `Id_UNIQUE` (`Id`,`GameId`) USING BTREE,
KEY `GameId_Idx` (`GameId`),
KEY `md5_Idx` (`MD5`) USING BTREE,
KEY `sha1_Idx` (`SHA1`) USING BTREE,
KEY `flags_Idx` ((cast(`Flags` as char(255) array)))
KEY `sha1_Idx` (`SHA1`) USING BTREE
);
DROP TABLE IF EXISTS `Signatures_Sources`;

View File

@@ -69,11 +69,11 @@ CREATE TABLE `RomCollections` (
`Id` BIGINT NOT NULL AUTO_INCREMENT,
`Name` VARCHAR(255) NULL,
`Description` LONGTEXT NULL,
`Platforms` JSON NULL,
`Genres` JSON NULL,
`Players` JSON NULL,
`PlayerPerspectives` JSON NULL,
`Themes` JSON NULL,
`Platforms` longtext NULL,
`Genres` longtext NULL,
`Players` longtext NULL,
`PlayerPerspectives` longtext NULL,
`Themes` longtext NULL,
`MinimumRating` INT NULL,
`MaximumRating` INT NULL,
`MaximumRomsPerPlatform` INT NULL,

View File

@@ -1,19 +1,16 @@
ALTER TABLE `Signatures_Roms`
DROP INDEX `flags_Idx`;
ALTER TABLE `Signatures_Roms`
ADD COLUMN `Attributes` JSON NULL AFTER `Flags`,
ADD COLUMN `Attributes` longtext NULL AFTER `Flags`,
ADD COLUMN `IngestorVersion` INT NULL DEFAULT 1;
ALTER TABLE `Games_Roms`
ADD COLUMN `Attributes` JSON NULL AFTER `Flags`,
ADD COLUMN `Attributes` longtext NULL AFTER `Flags`,
ADD COLUMN `MetadataGameName` VARCHAR(255) NULL AFTER `MetadataSource`,
ADD COLUMN `MetadataVersion` INT NULL DEFAULT 1;
ALTER TABLE `RomCollections`
ADD COLUMN `FolderStructure` INT NULL DEFAULT 0 AFTER `MaximumCollectionSizeInBytes`,
ADD COLUMN `IncludeBIOSFiles` BOOLEAN NULL DEFAULT 0 AFTER `FolderStructure`,
ADD COLUMN `AlwaysInclude` JSON NULL AFTER `IncludeBIOSFiles`;
ADD COLUMN `AlwaysInclude` longtext NULL AFTER `IncludeBIOSFiles`;
CREATE TABLE `PlatformMap` (
`Id` BIGINT NOT NULL,

View File

@@ -1,2 +1,2 @@
ALTER TABLE `PlatformMap`
ADD COLUMN `AvailableWebEmulators` JSON NULL;
ADD COLUMN `AvailableWebEmulators` longtext NULL;

View File

@@ -8,4 +8,32 @@ CREATE TABLE `GameLibraries` (
);
ALTER TABLE `Games_Roms`
ADD COLUMN `LibraryId` INT NULL DEFAULT 0 AFTER `MetadataVersion`;
ADD COLUMN `LibraryId` INT NULL DEFAULT 0 AFTER `MetadataVersion`;
CREATE TABLE `Relation_Game_Genres` (
`GameId` BIGINT NOT NULL,
`GenresId` BIGINT NOT NULL,
PRIMARY KEY (`GameId`, `GenresId`),
INDEX `idx_PrimaryColumn` (`GameId` ASC) VISIBLE
);
CREATE TABLE `Relation_Game_GameModes` (
`GameId` BIGINT NOT NULL,
`GameModesId` BIGINT NOT NULL,
PRIMARY KEY (`GameId`, `GameModesId`),
INDEX `idx_PrimaryColumn` (`GameId` ASC) VISIBLE
);
CREATE TABLE `Relation_Game_PlayerPerspectives` (
`GameId` BIGINT NOT NULL,
`PlayerPerspectivesId` BIGINT NOT NULL,
PRIMARY KEY (`GameId`, `PlayerPerspectivesId`),
INDEX `idx_PrimaryColumn` (`GameId` ASC) VISIBLE
);
CREATE TABLE `Relation_Game_Themes` (
`GameId` BIGINT NOT NULL,
`ThemesId` BIGINT NOT NULL,
PRIMARY KEY (`GameId`, `ThemesId`),
INDEX `idx_PrimaryColumn` (`GameId` ASC) VISIBLE
);