Difference between revisions of "Game Database Schema"

From LinuxMCE
Jump to: navigation, search
 
Line 24: Line 24:
 
     Description VARCHAR(128),
 
     Description VARCHAR(128),
 
     Define VARCHAR(128),
 
     Define VARCHAR(128),
     PRIMARY KEY(Attribute)
+
     PRIMARY KEY(PK_Attribute)
 +
);
 +
</pre>
 +
 
 +
=== Emulator ===
 +
 
 +
This table provides overall configuration data for a given emulator.
 +
 
 +
<pre>
 +
CREATE TABLE Emulator (
 +
    PK_Emulator INTEGER AUTO_INCREMENT NOT NULL,
 +
    Descripition VARCHAR(128),
 +
    Define CHARCHAR(128),
 +
    PRIMARY KEY(PK_Emulator)
 
);
 
);
 
</pre>
 
</pre>

Latest revision as of 21:29, 4 June 2017

This is the proposed schema for the lmce_game database. As the first version was used as is between the first two Game Player versions, the new version of the schema will be called v2.

As was before, this database is used to reconcile the possible metadata for game media found on a LinuxMCE system.

Goals

The goals with this particular database schema are:

  • Deal with the differences between "Software List" based collections that are baked collections for a given emulator (e.g. MAME soft list), and loose ROMs.
  • Try to consolidate media metadata to cleaned sanitized titles utilizing hashes made from normalized strings
  • Consolidate and Handle multiple game systems

Tables

The Database is comprised of the following tables:

Attribute

This stores the type of attributes to keep for media metadata.

CREATE TABLE Attribute (
    PK_Attribute INTEGER AUTO_INCREMENT NOT NULL,
    Description VARCHAR(128),
    Define VARCHAR(128),
    PRIMARY KEY(PK_Attribute)
);

Emulator

This table provides overall configuration data for a given emulator.

CREATE TABLE Emulator (
    PK_Emulator INTEGER AUTO_INCREMENT NOT NULL,
    Descripition VARCHAR(128),
    Define CHARCHAR(128),
    PRIMARY KEY(PK_Emulator)
);

File

This table is the entry point for a file, usually a ROM.

CREATE TABLE File  (
    PK_File INTEGER AUTO_INCREMENT NOT NULL,
    Description VARCHAR(1024),
    SHA1_Hash UNIQUE CHAR(40),
    PRIMARY_KEY(PK_File),
    KEY(SHA1_Hash)
);

GameSystem

A Game System is a particular system that can play a given game. Examples, Arcade, Atari 2600, NES, Sega Master System, etc.

CREATE TABLE GameSystem (
    PK_GameSystem INTEGER AUTO_INCREMENT NOT NULL,
    Description VARCHAR(128),
    PRIMARY KEY(PK_GameSystem)
);