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:
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Newtonsoft.Json;
|
||||
using IGDB.Models;
|
||||
|
||||
@@ -313,6 +312,16 @@ namespace gaseous_tools
|
||||
return dbConnString;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public string ConnectionStringNoDatabase
|
||||
{
|
||||
get
|
||||
{
|
||||
string dbConnString = "server=" + HostName + ";port=" + Port + ";userid=" + UserName + ";password=" + Password + ";";
|
||||
return dbConnString;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class Library
|
||||
|
@@ -3,7 +3,7 @@ using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using MySql.Data.MySqlClient;
|
||||
using MySqlConnector;
|
||||
using static gaseous_tools.Database;
|
||||
|
||||
namespace gaseous_tools
|
||||
@@ -69,7 +69,7 @@ namespace gaseous_tools
|
||||
ExecuteCMD(sql, dbDict, 30, "server=" + Config.DatabaseConfiguration.HostName + ";port=" + Config.DatabaseConfiguration.Port + ";userid=" + Config.DatabaseConfiguration.UserName + ";password=" + Config.DatabaseConfiguration.Password);
|
||||
|
||||
// check if schema version table is in place - if not, create the schema version table
|
||||
sql = "SELECT TABLE_SCHEMA, TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'gaseous' AND TABLE_NAME = 'schema_version';";
|
||||
sql = "SELECT TABLE_SCHEMA, TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = '" + Config.DatabaseConfiguration.DatabaseName + "' AND TABLE_NAME = 'schema_version';";
|
||||
DataTable SchemaVersionPresent = ExecuteCMD(sql, dbDict);
|
||||
if (SchemaVersionPresent.Rows.Count == 0)
|
||||
{
|
||||
|
@@ -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`;
|
||||
|
@@ -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,
|
||||
|
@@ -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,
|
||||
|
@@ -1,2 +1,2 @@
|
||||
ALTER TABLE `PlatformMap`
|
||||
ADD COLUMN `AvailableWebEmulators` JSON NULL;
|
||||
ADD COLUMN `AvailableWebEmulators` longtext NULL;
|
@@ -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
|
||||
);
|
@@ -3,7 +3,6 @@ using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Metadata.Ecma335;
|
||||
using Org.BouncyCastle.Utilities;
|
||||
namespace gaseous_tools
|
||||
{
|
||||
public class Logging
|
||||
|
@@ -9,7 +9,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="gaseous.IGDB" Version="1.0.1" />
|
||||
<PackageReference Include="MySql.Data" Version="8.1.0" />
|
||||
<PackageReference Include="MySqlConnector" Version="2.2.7" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
Reference in New Issue
Block a user