| 1 |
nino.borges |
795 |
"""
|
| 2 |
|
|
This creates the inital Gromulus database. I'm assuming I'll use this once and then maybe each time I update the schema, doing my data migration manually.
|
| 3 |
|
|
"""
|
| 4 |
|
|
|
| 5 |
|
|
import sqlite3
|
| 6 |
|
|
|
| 7 |
|
|
conn = sqlite3.connect("GromulusDatabase.db")
|
| 8 |
|
|
|
| 9 |
|
|
cursor = conn.cursor()
|
| 10 |
|
|
|
| 11 |
|
|
# Creating the database
|
| 12 |
|
|
|
| 13 |
|
|
cursor.execute("""CREATE TABLE main_app(id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, game_name TEXT, game_name_scraped TEXT, file_name TEXT, relative_file_path TEXT, description TEXT, description_scraped TEXT, system_console INTEGER, system_console_scraped TEXT, path_to_screenshot TEXT, path_to_video TEXT, user_notes TEXT, md5 TEXT, version text)""")
|
| 14 |
|
|
|
| 15 |
|
|
cursor.execute("""CREATE TABLE no_intro_system(id INTEGER NOT NULL PRIMARY KEY, name TEXT, description TEXT, dat_version TEXT)""")
|
| 16 |
|
|
#conn.commit()
|
| 17 |
|
|
|
| 18 |
|
|
cursor.execute("""CREATE TABLE no_intro_main (game_name TEXT, no_intro_id TEXT, clone_of_id TEXT, description TEXT, rom_name TEXT, crc TEXT, md5 TEXT, sha1 TEXT, sha256 TEXT, status TEXT, no_intro_system_id INTEGER NOT NULL, FOREIGN KEY (no_intro_system_id) REFERENCES no_intro_system(id) )""")
|
| 19 |
|
|
conn.commit() |