feat(db): Ensure no duplicate data in the DB
This commit is contained in:
parent
a0357b3ee3
commit
bf2336386e
|
@ -1,8 +1,8 @@
|
||||||
-- Your SQL goes here
|
-- Your SQL goes here
|
||||||
CREATE TABLE game_file (
|
CREATE TABLE game_file (
|
||||||
id INTEGER PRIMARY KEY NOT NULL,
|
id INTEGER PRIMARY KEY NOT NULL,
|
||||||
original_path TEXT NOT NULL, -- TEXT assumes a Unicode Encoding
|
original_path TEXT NOT NULL UNIQUE, -- TEXT assumes a Unicode Encoding
|
||||||
file_hash BLOB NOT NULL,
|
file_hash BLOB NOT NULL UNIQUE,
|
||||||
game_save_id INTEGER NOT NULL,
|
game_save_id INTEGER NOT NULL,
|
||||||
FOREIGN KEY (game_save_id) REFERENCES game_save_location (id)
|
FOREIGN KEY (game_save_id) REFERENCES game_save_location (id)
|
||||||
)
|
)
|
|
@ -1,7 +1,7 @@
|
||||||
-- Your SQL goes here
|
-- Your SQL goes here
|
||||||
CREATE TABLE game_save_location (
|
CREATE TABLE game_save_location (
|
||||||
id INTEGER PRIMARY KEY NOT NULL,
|
id INTEGER PRIMARY KEY NOT NULL,
|
||||||
friendly_name TEXT, -- This can be null
|
friendly_name TEXT UNIQUE, -- This can be null
|
||||||
original_path TEXT NOT NULL,
|
original_path TEXT NOT NULL UNIQUE,
|
||||||
uuid BLOB NOT NULL
|
uuid BLOB NOT NULL UNIQUE
|
||||||
)
|
)
|
Loading…
Reference in New Issue