All images now support rootless (#418)
This commit is contained in:
@@ -14,19 +14,14 @@ RUN dotnet restore "gaseous-server/gaseous-server.csproj" -a $TARGETARCH
|
|||||||
# Build and publish a release
|
# Build and publish a release
|
||||||
RUN dotnet publish "gaseous-server/gaseous-server.csproj" --use-current-runtime --self-contained true -c Release -o out -a $TARGETARCH
|
RUN dotnet publish "gaseous-server/gaseous-server.csproj" --use-current-runtime --self-contained true -c Release -o out -a $TARGETARCH
|
||||||
|
|
||||||
# disabled for 1.7.4 as the next version EmulatorJS is not yet available
|
# update apt-get
|
||||||
# # update apt-get
|
RUN apt-get update
|
||||||
# RUN apt-get update
|
|
||||||
|
|
||||||
# # download and unzip EmulatorJS from CDN
|
# # download and unzip EmulatorJS from CDN
|
||||||
# RUN apt-get install -y p7zip-full
|
RUN apt-get install -y p7zip-full
|
||||||
# RUN mkdir -p out/wwwroot/emulators/EmulatorJS
|
|
||||||
# RUN wget https://cdn.emulatorjs.org/releases/4.0.12.7z
|
|
||||||
# RUN 7z x -y -oout/wwwroot/emulators/EmulatorJS 4.0.12.7z
|
|
||||||
RUN wget --recursive --no-parent https://cdn.emulatorjs.org/latest/
|
|
||||||
RUN mkdir -p out/wwwroot/emulators/EmulatorJS
|
RUN mkdir -p out/wwwroot/emulators/EmulatorJS
|
||||||
RUN cp -fr cdn.emulatorjs.org/latest/* out/wwwroot/emulators/EmulatorJS
|
RUN wget https://cdn.emulatorjs.org/releases/4.0.12.7z
|
||||||
RUN rm -Rf cdn.emulatorjs.org
|
RUN 7z x -y -oout/wwwroot/emulators/EmulatorJS 4.0.12.7z
|
||||||
|
|
||||||
# clean up apt-get
|
# clean up apt-get
|
||||||
RUN apt-get clean && rm -rf /var/lib/apt/lists
|
RUN apt-get clean && rm -rf /var/lib/apt/lists
|
||||||
@@ -37,5 +32,34 @@ ENV INDOCKER=1
|
|||||||
WORKDIR /App
|
WORKDIR /App
|
||||||
COPY --from=build-env /App/out .
|
COPY --from=build-env /App/out .
|
||||||
|
|
||||||
# start gaseous-server
|
# variables
|
||||||
ENTRYPOINT ["dotnet", "gaseous-server.dll"]
|
ARG PUID=1000
|
||||||
|
ARG PGID=1000
|
||||||
|
ARG dbhost=localhost
|
||||||
|
ARG dbuser=root
|
||||||
|
ARG dbpass=gaseous
|
||||||
|
|
||||||
|
ENV PUID=${PUID}
|
||||||
|
ENV PGID=${PGID}
|
||||||
|
ENV dbhost=${dbhost}
|
||||||
|
ENV dbuser=${dbuser}
|
||||||
|
ENV dbpass=${dbpass}
|
||||||
|
|
||||||
|
# install supervisord
|
||||||
|
RUN apt-get update && apt-get install -y supervisor
|
||||||
|
COPY ../build/standard/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||||
|
RUN mkdir -p /var/run/supervisord
|
||||||
|
RUN mkdir -p /var/log/supervisord
|
||||||
|
|
||||||
|
# clean up apt-get
|
||||||
|
RUN apt-get clean && rm -rf /var/lib/apt/lists
|
||||||
|
|
||||||
|
# copy entrypoint
|
||||||
|
COPY ../build/standard/entrypoint.sh /usr/sbin/entrypoint.sh
|
||||||
|
RUN chmod +x /usr/sbin/entrypoint.sh
|
||||||
|
|
||||||
|
# volumes
|
||||||
|
VOLUME /home/gaseous/.gaseous-server
|
||||||
|
|
||||||
|
# start services
|
||||||
|
ENTRYPOINT [ "/usr/sbin/entrypoint.sh" ]
|
@@ -14,19 +14,14 @@ RUN dotnet restore "gaseous-server/gaseous-server.csproj" -a $TARGETARCH
|
|||||||
# Build and publish a release
|
# Build and publish a release
|
||||||
RUN dotnet publish "gaseous-server/gaseous-server.csproj" --use-current-runtime --self-contained true -c Release -o out -a $TARGETARCH
|
RUN dotnet publish "gaseous-server/gaseous-server.csproj" --use-current-runtime --self-contained true -c Release -o out -a $TARGETARCH
|
||||||
|
|
||||||
# disabled for 1.7.4 as the next version EmulatorJS is not yet available
|
# update apt-get
|
||||||
# # update apt-get
|
RUN apt-get update
|
||||||
# RUN apt-get update
|
|
||||||
|
|
||||||
# # download and unzip EmulatorJS from CDN
|
# # download and unzip EmulatorJS from CDN
|
||||||
# RUN apt-get install -y p7zip-full
|
RUN apt-get install -y p7zip-full
|
||||||
# RUN mkdir -p out/wwwroot/emulators/EmulatorJS
|
|
||||||
# RUN wget https://cdn.emulatorjs.org/releases/4.0.12.7z
|
|
||||||
# RUN 7z x -y -oout/wwwroot/emulators/EmulatorJS 4.0.12.7z
|
|
||||||
RUN wget --recursive --no-parent https://cdn.emulatorjs.org/latest/
|
|
||||||
RUN mkdir -p out/wwwroot/emulators/EmulatorJS
|
RUN mkdir -p out/wwwroot/emulators/EmulatorJS
|
||||||
RUN cp -fr cdn.emulatorjs.org/latest/* out/wwwroot/emulators/EmulatorJS
|
RUN wget https://cdn.emulatorjs.org/releases/4.0.12.7z
|
||||||
RUN rm -Rf cdn.emulatorjs.org
|
RUN 7z x -y -oout/wwwroot/emulators/EmulatorJS 4.0.12.7z
|
||||||
|
|
||||||
# Build runtime image
|
# Build runtime image
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0
|
||||||
@@ -35,27 +30,42 @@ WORKDIR /App
|
|||||||
COPY --from=build-env /App/out .
|
COPY --from=build-env /App/out .
|
||||||
|
|
||||||
# variables
|
# variables
|
||||||
ENV dbhost=localhost
|
ARG PUID=1000
|
||||||
ENV dbuser=root
|
ARG PGID=1000
|
||||||
ENV dbpass=gaseous
|
ARG dbhost=localhost
|
||||||
ENV MARIADB_ROOT_PASSWORD=$dbpass
|
ARG dbuser=root
|
||||||
|
ARG dbpass=gaseous
|
||||||
|
ARG MARIADB_ROOT_PASSWORD=$dbpass
|
||||||
|
|
||||||
|
ENV PUID=${PUID}
|
||||||
|
ENV PGID=${PGID}
|
||||||
|
ENV dbhost=${dbhost}
|
||||||
|
ENV dbuser=${dbuser}
|
||||||
|
ENV dbpass=${dbpass}
|
||||||
|
ENV MARIADB_ROOT_PASSWORD=${dbpass}
|
||||||
|
|
||||||
# install mariadb
|
# install mariadb
|
||||||
RUN DEBIAN_FRONTEND=noninteractive && \
|
RUN DEBIAN_FRONTEND=noninteractive && \
|
||||||
apt-get update && apt-get install -y mariadb-server
|
apt-get update && apt-get install -y mariadb-server
|
||||||
RUN mkdir -p /run/mysqld
|
RUN mkdir -p /run/mysqld
|
||||||
COPY ../build/mariadb.sh /usr/sbin/start-mariadb.sh
|
COPY ../build/embeddeddb/mariadb.sh /usr/sbin/start-mariadb.sh
|
||||||
RUN chmod +x /usr/sbin/start-mariadb.sh
|
RUN chmod +x /usr/sbin/start-mariadb.sh
|
||||||
|
|
||||||
# install supervisord
|
# install supervisord
|
||||||
RUN apt-get install -y supervisor
|
RUN apt-get install -y supervisor
|
||||||
COPY ../build/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
COPY ../build/embeddeddb/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||||
|
RUN mkdir -p /var/run/supervisord
|
||||||
|
RUN mkdir -p /var/log/supervisord
|
||||||
|
|
||||||
# clean up apt-get
|
# clean up apt-get
|
||||||
RUN apt-get clean && rm -rf /var/lib/apt/lists
|
RUN apt-get clean && rm -rf /var/lib/apt/lists
|
||||||
|
|
||||||
|
# copy entrypoint
|
||||||
|
COPY ../build/embeddeddb/entrypoint.sh /usr/sbin/entrypoint.sh
|
||||||
|
RUN chmod +x /usr/sbin/entrypoint.sh
|
||||||
|
|
||||||
# volumes
|
# volumes
|
||||||
VOLUME /root/.gaseous-server /var/lib/mysql
|
VOLUME /home/gaseous/.gaseous-server /var/lib/mysql
|
||||||
|
|
||||||
# start services
|
# start services
|
||||||
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
ENTRYPOINT [ "/usr/sbin/entrypoint.sh" ]
|
18
build/embeddeddb/entrypoint.sh
Normal file
18
build/embeddeddb/entrypoint.sh
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# create the user
|
||||||
|
echo "Creating user gaseous with UID ${PUID} and GID ${PGID}"
|
||||||
|
groupadd -g ${PGID} gaseous
|
||||||
|
useradd -u ${PUID} -g ${PGID} -m gaseous -d /home/gaseous -G sudo
|
||||||
|
usermod -p "*" gaseous
|
||||||
|
mkdir -p /home/gaseous/.gaseous-server
|
||||||
|
chown -R ${PUID} /App /home/gaseous/.gaseous-server
|
||||||
|
chgrp -R ${PGID} /App /home/gaseous/.gaseous-server
|
||||||
|
|
||||||
|
# Set MariaDB permissions
|
||||||
|
mkdir -p /var/lib/mysql /var/log/mariadb /run/mysqld
|
||||||
|
chown -R ${PUID} /var/lib/mysql /var/log/mariadb /run/mysqld
|
||||||
|
chgrp -R ${PGID} /var/lib/mysql /var/log/mariadb /run/mysqld
|
||||||
|
|
||||||
|
# Start supervisord and services
|
||||||
|
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
|
25
build/embeddeddb/mariadb.sh
Normal file
25
build/embeddeddb/mariadb.sh
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# install the database
|
||||||
|
echo "Installing MariaDB"
|
||||||
|
/usr/bin/mariadb-install-db --datadir=/var/lib/mysql --user=gaseous
|
||||||
|
|
||||||
|
# start the database server without network or grant tables
|
||||||
|
echo "Starting MariaDB"
|
||||||
|
/usr/sbin/mariadbd --datadir=/var/lib/mysql --skip-grant-tables --skip-networking &
|
||||||
|
|
||||||
|
# wait for the server to start
|
||||||
|
sleep 5
|
||||||
|
|
||||||
|
# change the root password
|
||||||
|
echo "Setting MariaDB root password"
|
||||||
|
mariadb -u root -e "FLUSH PRIVILEGES; ALTER USER 'root'@'localhost' IDENTIFIED BY '$MARIADB_ROOT_PASSWORD'; ALTER USER 'gaseous'@'localhost' IDENTIFIED BY '$MARIADB_ROOT_PASSWORD'; FLUSH PRIVILEGES; SHUTDOWN;"
|
||||||
|
|
||||||
|
# stop the server
|
||||||
|
sleep 5
|
||||||
|
echo "Stopping MariaDB"
|
||||||
|
killall mariadbd
|
||||||
|
|
||||||
|
# start the server normally
|
||||||
|
echo "Starting MariaDB"
|
||||||
|
/usr/sbin/mariadbd --datadir=/var/lib/mysql --user=gaseous
|
37
build/embeddeddb/supervisord.conf
Normal file
37
build/embeddeddb/supervisord.conf
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
[supervisord]
|
||||||
|
user=root
|
||||||
|
nodaemon=true
|
||||||
|
logfile=/var/log/supervisord/supervisord.log
|
||||||
|
logfile_maxbytes=50
|
||||||
|
logfile_backups=5
|
||||||
|
pidfile=/var/run/supervisord/supervisord.pid
|
||||||
|
loglevel = info
|
||||||
|
|
||||||
|
[unix_http_server]
|
||||||
|
file=/var/run/supervisord/supervisor.sock
|
||||||
|
chmod=0700
|
||||||
|
|
||||||
|
[rpcinterface:supervisor]
|
||||||
|
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||||
|
|
||||||
|
[supervisorctl]
|
||||||
|
serverurl=unix:///var/run/supervisord/supervisor.sock
|
||||||
|
|
||||||
|
[program:mariadb]
|
||||||
|
user=gaseous
|
||||||
|
command=bash -c "/usr/sbin/start-mariadb.sh"
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
redirect_stderr=true
|
||||||
|
stdout_logfile=/dev/fd/1
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
|
||||||
|
[program:gaseous-server]
|
||||||
|
user=gaseous
|
||||||
|
command=dotnet /App/gaseous-server.dll
|
||||||
|
environment=HOME="/home/gaseous",USER="gaseous"
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
redirect_stderr=true
|
||||||
|
stdout_logfile=/dev/fd/1
|
||||||
|
stdout_logfile_maxbytes=0
|
@@ -1,9 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Wait for the service to start
|
|
||||||
while ! mysqladmin ping -h localhost --silent; do
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
|
|
||||||
# Set the root password
|
|
||||||
mariadb -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '$MARIADB_ROOT_PASSWORD';"
|
|
13
build/standard/entrypoint.sh
Normal file
13
build/standard/entrypoint.sh
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# create the user
|
||||||
|
echo "Creating user gaseous with UID ${PUID} and GID ${PGID}"
|
||||||
|
groupadd -g ${PGID} gaseous
|
||||||
|
useradd -u ${PUID} -g ${PGID} -m gaseous -d /home/gaseous -G sudo
|
||||||
|
usermod -p "*" gaseous
|
||||||
|
mkdir -p /home/gaseous/.gaseous-server
|
||||||
|
chown -R ${PUID} /App /home/gaseous/.gaseous-server
|
||||||
|
chgrp -R ${PGID} /App /home/gaseous/.gaseous-server
|
||||||
|
|
||||||
|
# Start supervisord and services
|
||||||
|
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
|
28
build/standard/supervisord.conf
Normal file
28
build/standard/supervisord.conf
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
[supervisord]
|
||||||
|
user=root
|
||||||
|
nodaemon=true
|
||||||
|
logfile=/var/log/supervisord/supervisord.log
|
||||||
|
logfile_maxbytes=50
|
||||||
|
logfile_backups=5
|
||||||
|
pidfile=/var/run/supervisord/supervisord.pid
|
||||||
|
loglevel = info
|
||||||
|
|
||||||
|
[unix_http_server]
|
||||||
|
file=/var/run/supervisord/supervisor.sock
|
||||||
|
chmod=0700
|
||||||
|
|
||||||
|
[rpcinterface:supervisor]
|
||||||
|
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||||
|
|
||||||
|
[supervisorctl]
|
||||||
|
serverurl=unix:///var/run/supervisord/supervisor.sock
|
||||||
|
|
||||||
|
[program:gaseous-server]
|
||||||
|
user=gaseous
|
||||||
|
command=dotnet /App/gaseous-server.dll
|
||||||
|
environment=HOME="/home/gaseous",USER="gaseous"
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
redirect_stderr=true
|
||||||
|
stdout_logfile=/dev/fd/1
|
||||||
|
stdout_logfile_maxbytes=0
|
@@ -1,31 +0,0 @@
|
|||||||
[supervisord]
|
|
||||||
user=root
|
|
||||||
nodaemon=true
|
|
||||||
logfile=/dev/null
|
|
||||||
logfile_maxbytes=0
|
|
||||||
pidfile=/var/run/supervisord.pid
|
|
||||||
loglevel = INFO
|
|
||||||
|
|
||||||
[program:mariadb]
|
|
||||||
command=/usr/sbin/mariadbd --user=root
|
|
||||||
autostart=true
|
|
||||||
autorestart=true
|
|
||||||
redirect_stderr=true
|
|
||||||
stdout_logfile=/dev/fd/1
|
|
||||||
stdout_logfile_maxbytes=0
|
|
||||||
|
|
||||||
[program:mariadb-setup]
|
|
||||||
command=bash -c "/usr/sbin/start-mariadb.sh"
|
|
||||||
autostart=true
|
|
||||||
autorestart=false
|
|
||||||
redirect_stderr=true
|
|
||||||
stdout_logfile=/dev/fd/1
|
|
||||||
stdout_logfile_maxbytes=0
|
|
||||||
|
|
||||||
[program:gaseous-server]
|
|
||||||
command=dotnet /App/gaseous-server.dll
|
|
||||||
autostart=true
|
|
||||||
autorestart=true
|
|
||||||
redirect_stderr=true
|
|
||||||
stdout_logfile=/dev/fd/1
|
|
||||||
stdout_logfile_maxbytes=0
|
|
@@ -4,6 +4,7 @@ services:
|
|||||||
container_name: gaseous-server
|
container_name: gaseous-server
|
||||||
build:
|
build:
|
||||||
context: ./
|
context: ./
|
||||||
|
dockerfile: ./build/Dockerfile
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- gaseous
|
- gaseous
|
||||||
@@ -12,7 +13,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 5198:80
|
- 5198:80
|
||||||
volumes:
|
volumes:
|
||||||
- gs:/root/.gaseous-server
|
- gs:/home/gaseous/.gaseous-server
|
||||||
environment:
|
environment:
|
||||||
- TZ=Australia/Sydney
|
- TZ=Australia/Sydney
|
||||||
- dbhost=gsdb
|
- dbhost=gsdb
|
||||||
|
@@ -11,7 +11,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 5198:80
|
- 5198:80
|
||||||
volumes:
|
volumes:
|
||||||
- gs:/root/.gaseous-server
|
- gs:/home/gaseous/.gaseous-server
|
||||||
environment:
|
environment:
|
||||||
- TZ=Australia/Sydney
|
- TZ=Australia/Sydney
|
||||||
- dbhost=gsdb
|
- dbhost=gsdb
|
||||||
|
@@ -109,7 +109,7 @@ namespace gaseous_server.Classes
|
|||||||
db.ExecuteNonQuery(sql);
|
db.ExecuteNonQuery(sql);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1022:
|
case 1023:
|
||||||
// load country list
|
// load country list
|
||||||
Logging.Log(Logging.LogType.Information, "Database Upgrade", "Adding country look up table contents");
|
Logging.Log(Logging.LogType.Information, "Database Upgrade", "Adding country look up table contents");
|
||||||
|
|
||||||
@@ -151,10 +151,10 @@ namespace gaseous_server.Classes
|
|||||||
}
|
}
|
||||||
|
|
||||||
// this is a safe background task
|
// this is a safe background task
|
||||||
BackgroundUpgradeTargetSchemaVersions.Add(1022);
|
BackgroundUpgradeTargetSchemaVersions.Add(1023);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1023:
|
case 1024:
|
||||||
// create profiles for all existing users
|
// create profiles for all existing users
|
||||||
sql = "SELECT * FROM Users;";
|
sql = "SELECT * FROM Users;";
|
||||||
data = db.ExecuteCMD(sql);
|
data = db.ExecuteCMD(sql);
|
||||||
@@ -197,8 +197,8 @@ namespace gaseous_server.Classes
|
|||||||
MySql_1002_MigrateMetadataVersion();
|
MySql_1002_MigrateMetadataVersion();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1022:
|
case 1023:
|
||||||
MySql_1022_MigrateMetadataVersion();
|
MySql_1023_MigrateMetadataVersion();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -301,7 +301,7 @@ namespace gaseous_server.Classes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void MySql_1022_MigrateMetadataVersion()
|
public static void MySql_1023_MigrateMetadataVersion()
|
||||||
{
|
{
|
||||||
FileSignature fileSignature = new FileSignature();
|
FileSignature fileSignature = new FileSignature();
|
||||||
|
|
||||||
|
@@ -67,7 +67,7 @@ if (Directory.Exists(Config.LibraryConfiguration.LibraryUploadDirectory))
|
|||||||
// kick off any delayed upgrade tasks
|
// kick off any delayed upgrade tasks
|
||||||
// run 1002 background updates in the background on every start
|
// run 1002 background updates in the background on every start
|
||||||
DatabaseMigration.BackgroundUpgradeTargetSchemaVersions.Add(1002);
|
DatabaseMigration.BackgroundUpgradeTargetSchemaVersions.Add(1002);
|
||||||
DatabaseMigration.BackgroundUpgradeTargetSchemaVersions.Add(1022);
|
DatabaseMigration.BackgroundUpgradeTargetSchemaVersions.Add(1023);
|
||||||
// start the task
|
// start the task
|
||||||
ProcessQueue.QueueItem queueItem = new ProcessQueue.QueueItem(
|
ProcessQueue.QueueItem queueItem = new ProcessQueue.QueueItem(
|
||||||
ProcessQueue.QueueItemType.BackgroundDatabaseUpgrade,
|
ProcessQueue.QueueItemType.BackgroundDatabaseUpgrade,
|
||||||
|
@@ -1,23 +1,3 @@
|
|||||||
CREATE TABLE `Signatures_RomToSource` (
|
|
||||||
`SourceId` int NOT NULL,
|
|
||||||
`RomId` int NOT NULL,
|
|
||||||
PRIMARY KEY (`SourceId`, `RomId`)
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE TABLE `Signatures_Games_Countries` (
|
|
||||||
`GameId` INT NOT NULL,
|
|
||||||
`CountryId` INT NOT NULL,
|
|
||||||
PRIMARY KEY (`GameId`, `CountryId`),
|
|
||||||
CONSTRAINT `GameCountry` FOREIGN KEY (`GameId`) REFERENCES `Signatures_Games` (`Id`) ON DELETE CASCADE ON UPDATE NO ACTION
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE TABLE `Signatures_Games_Languages` (
|
|
||||||
`GameId` INT NOT NULL,
|
|
||||||
`LanguageId` INT NOT NULL,
|
|
||||||
PRIMARY KEY (`GameId`, `LanguageId`),
|
|
||||||
CONSTRAINT `GameLanguage` FOREIGN KEY (`GameId`) REFERENCES `Signatures_Games` (`Id`) ON DELETE CASCADE ON UPDATE NO ACTION
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE TABLE `Country` (
|
CREATE TABLE `Country` (
|
||||||
`Id` INT NOT NULL AUTO_INCREMENT,
|
`Id` INT NOT NULL AUTO_INCREMENT,
|
||||||
`Code` VARCHAR(20) NULL,
|
`Code` VARCHAR(20) NULL,
|
||||||
@@ -35,63 +15,3 @@ CREATE TABLE `Language` (
|
|||||||
INDEX `id_Code` (`Code` ASC) VISIBLE,
|
INDEX `id_Code` (`Code` ASC) VISIBLE,
|
||||||
INDEX `id_Value` (`Value` ASC) VISIBLE
|
INDEX `id_Value` (`Value` ASC) VISIBLE
|
||||||
);
|
);
|
||||||
|
|
||||||
ALTER TABLE `Games_Roms` ADD COLUMN `RomDataVersion` INT DEFAULT 1;
|
|
||||||
|
|
||||||
CREATE TABLE UserProfiles (
|
|
||||||
`Id` VARCHAR(45) NOT NULL,
|
|
||||||
`UserId` VARCHAR(45) NOT NULL,
|
|
||||||
`DisplayName` VARCHAR(255) NOT NULL,
|
|
||||||
`Quip` VARCHAR(255) NOT NULL,
|
|
||||||
`Avatar` LONGBLOB,
|
|
||||||
`AvatarExtension` CHAR(6),
|
|
||||||
`ProfileBackground` LONGBLOB,
|
|
||||||
`ProfileBackgroundExtension` CHAR(6),
|
|
||||||
`UnstructuredData` LONGTEXT NOT NULL,
|
|
||||||
PRIMARY KEY (`Id`, `UserId`)
|
|
||||||
);
|
|
||||||
|
|
||||||
ALTER TABLE `PlatformMap_Bios`
|
|
||||||
ADD COLUMN `Enabled` BOOLEAN DEFAULT TRUE;
|
|
||||||
|
|
||||||
CREATE TABLE `User_PlatformMap` (
|
|
||||||
`id` VARCHAR(128) NOT NULL,
|
|
||||||
`GameId` BIGINT NOT NULL,
|
|
||||||
`PlatformId` BIGINT NOT NULL,
|
|
||||||
`Mapping` LONGTEXT,
|
|
||||||
PRIMARY KEY (`id`, `GameId`, `PlatformId`),
|
|
||||||
CONSTRAINT `User_PlatformMap_UserId` FOREIGN KEY (`id`) REFERENCES `Users` (`Id`) ON DELETE CASCADE
|
|
||||||
);
|
|
||||||
|
|
||||||
ALTER TABLE `UserTimeTracking`
|
|
||||||
ADD COLUMN `PlatformId` BIGINT,
|
|
||||||
ADD COLUMN `IsMediaGroup` BOOLEAN DEFAULT FALSE,
|
|
||||||
ADD COLUMN `RomId` BIGINT;
|
|
||||||
|
|
||||||
CREATE TABLE `User_RecentPlayedRoms` (
|
|
||||||
`UserId` varchar(128) NOT NULL,
|
|
||||||
`GameId` bigint(20) NOT NULL,
|
|
||||||
`PlatformId` bigint(20) NOT NULL,
|
|
||||||
`RomId` bigint(20) NOT NULL,
|
|
||||||
`IsMediaGroup` tinyint(1) DEFAULT NULL,
|
|
||||||
PRIMARY KEY (
|
|
||||||
`UserId`,
|
|
||||||
`GameId`,
|
|
||||||
`PlatformId`
|
|
||||||
),
|
|
||||||
CONSTRAINT `RecentPlayedRoms_Users` FOREIGN KEY (`UserId`) REFERENCES `Users` (`Id`) ON DELETE CASCADE
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE TABLE `User_GameFavouriteRoms` (
|
|
||||||
`UserId` varchar(128) NOT NULL,
|
|
||||||
`GameId` bigint(20) NOT NULL,
|
|
||||||
`PlatformId` bigint(20) NOT NULL,
|
|
||||||
`RomId` bigint(20) NOT NULL,
|
|
||||||
`IsMediaGroup` tinyint(1) DEFAULT NULL,
|
|
||||||
PRIMARY KEY (
|
|
||||||
`UserId`,
|
|
||||||
`GameId`,
|
|
||||||
`PlatformId`
|
|
||||||
),
|
|
||||||
CONSTRAINT `GameFavouriteRoms_Users` FOREIGN KEY (`UserId`) REFERENCES `Users` (`Id`) ON DELETE CASCADE
|
|
||||||
);
|
|
79
gaseous-server/Support/Database/MySQL/gaseous-1024.sql
Normal file
79
gaseous-server/Support/Database/MySQL/gaseous-1024.sql
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
CREATE TABLE `Signatures_RomToSource` (
|
||||||
|
`SourceId` int NOT NULL,
|
||||||
|
`RomId` int NOT NULL,
|
||||||
|
PRIMARY KEY (`SourceId`, `RomId`)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE `Signatures_Games_Countries` (
|
||||||
|
`GameId` INT NOT NULL,
|
||||||
|
`CountryId` INT NOT NULL,
|
||||||
|
PRIMARY KEY (`GameId`, `CountryId`),
|
||||||
|
CONSTRAINT `GameCountry` FOREIGN KEY (`GameId`) REFERENCES `Signatures_Games` (`Id`) ON DELETE CASCADE ON UPDATE NO ACTION
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE `Signatures_Games_Languages` (
|
||||||
|
`GameId` INT NOT NULL,
|
||||||
|
`LanguageId` INT NOT NULL,
|
||||||
|
PRIMARY KEY (`GameId`, `LanguageId`),
|
||||||
|
CONSTRAINT `GameLanguage` FOREIGN KEY (`GameId`) REFERENCES `Signatures_Games` (`Id`) ON DELETE CASCADE ON UPDATE NO ACTION
|
||||||
|
);
|
||||||
|
|
||||||
|
ALTER TABLE `Games_Roms` ADD COLUMN `RomDataVersion` INT DEFAULT 1;
|
||||||
|
|
||||||
|
CREATE TABLE UserProfiles (
|
||||||
|
`Id` VARCHAR(45) NOT NULL,
|
||||||
|
`UserId` VARCHAR(45) NOT NULL,
|
||||||
|
`DisplayName` VARCHAR(255) NOT NULL,
|
||||||
|
`Quip` VARCHAR(255) NOT NULL,
|
||||||
|
`Avatar` LONGBLOB,
|
||||||
|
`AvatarExtension` CHAR(6),
|
||||||
|
`ProfileBackground` LONGBLOB,
|
||||||
|
`ProfileBackgroundExtension` CHAR(6),
|
||||||
|
`UnstructuredData` LONGTEXT NOT NULL,
|
||||||
|
PRIMARY KEY (`Id`, `UserId`)
|
||||||
|
);
|
||||||
|
|
||||||
|
ALTER TABLE `PlatformMap_Bios`
|
||||||
|
ADD COLUMN `Enabled` BOOLEAN DEFAULT TRUE;
|
||||||
|
|
||||||
|
CREATE TABLE `User_PlatformMap` (
|
||||||
|
`id` VARCHAR(128) NOT NULL,
|
||||||
|
`GameId` BIGINT NOT NULL,
|
||||||
|
`PlatformId` BIGINT NOT NULL,
|
||||||
|
`Mapping` LONGTEXT,
|
||||||
|
PRIMARY KEY (`id`, `GameId`, `PlatformId`),
|
||||||
|
CONSTRAINT `User_PlatformMap_UserId` FOREIGN KEY (`id`) REFERENCES `Users` (`Id`) ON DELETE CASCADE
|
||||||
|
);
|
||||||
|
|
||||||
|
ALTER TABLE `UserTimeTracking`
|
||||||
|
ADD COLUMN `PlatformId` BIGINT,
|
||||||
|
ADD COLUMN `IsMediaGroup` BOOLEAN DEFAULT FALSE,
|
||||||
|
ADD COLUMN `RomId` BIGINT;
|
||||||
|
|
||||||
|
CREATE TABLE `User_RecentPlayedRoms` (
|
||||||
|
`UserId` varchar(128) NOT NULL,
|
||||||
|
`GameId` bigint(20) NOT NULL,
|
||||||
|
`PlatformId` bigint(20) NOT NULL,
|
||||||
|
`RomId` bigint(20) NOT NULL,
|
||||||
|
`IsMediaGroup` tinyint(1) DEFAULT NULL,
|
||||||
|
PRIMARY KEY (
|
||||||
|
`UserId`,
|
||||||
|
`GameId`,
|
||||||
|
`PlatformId`
|
||||||
|
),
|
||||||
|
CONSTRAINT `RecentPlayedRoms_Users` FOREIGN KEY (`UserId`) REFERENCES `Users` (`Id`) ON DELETE CASCADE
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE `User_GameFavouriteRoms` (
|
||||||
|
`UserId` varchar(128) NOT NULL,
|
||||||
|
`GameId` bigint(20) NOT NULL,
|
||||||
|
`PlatformId` bigint(20) NOT NULL,
|
||||||
|
`RomId` bigint(20) NOT NULL,
|
||||||
|
`IsMediaGroup` tinyint(1) DEFAULT NULL,
|
||||||
|
PRIMARY KEY (
|
||||||
|
`UserId`,
|
||||||
|
`GameId`,
|
||||||
|
`PlatformId`
|
||||||
|
),
|
||||||
|
CONSTRAINT `GameFavouriteRoms_Users` FOREIGN KEY (`UserId`) REFERENCES `Users` (`Id`) ON DELETE CASCADE
|
||||||
|
);
|
@@ -68,6 +68,7 @@
|
|||||||
<None Remove="Support\Database\MySQL\gaseous-1021.sql" />
|
<None Remove="Support\Database\MySQL\gaseous-1021.sql" />
|
||||||
<None Remove="Support\Database\MySQL\gaseous-1022.sql" />
|
<None Remove="Support\Database\MySQL\gaseous-1022.sql" />
|
||||||
<None Remove="Support\Database\MySQL\gaseous-1023.sql" />
|
<None Remove="Support\Database\MySQL\gaseous-1023.sql" />
|
||||||
|
<None Remove="Support\Database\MySQL\gaseous-1024.sql" />
|
||||||
<None Remove="Classes\Metadata\" />
|
<None Remove="Classes\Metadata\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -116,5 +117,6 @@
|
|||||||
<EmbeddedResource Include="Support\Database\MySQL\gaseous-1021.sql" />
|
<EmbeddedResource Include="Support\Database\MySQL\gaseous-1021.sql" />
|
||||||
<EmbeddedResource Include="Support\Database\MySQL\gaseous-1022.sql" />
|
<EmbeddedResource Include="Support\Database\MySQL\gaseous-1022.sql" />
|
||||||
<EmbeddedResource Include="Support\Database\MySQL\gaseous-1023.sql" />
|
<EmbeddedResource Include="Support\Database\MySQL\gaseous-1023.sql" />
|
||||||
|
<EmbeddedResource Include="Support\Database\MySQL\gaseous-1024.sql" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
Reference in New Issue
Block a user