ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/Gromulus/GromulusDatabaseUtilities.py
Revision: 806
Committed: Thu Dec 21 18:25:36 2023 UTC (2 years, 3 months ago) by nino.borges
Content type: text/x-python
Original Path: Python/NinoCode/Active_prgs/Gromulus/CreateGromulusDB.py
File size: 1442 byte(s)
Log Message:
I'm tagging this as the final version of version 1. This version works, although it's limited, but it doesnt support zip files and archives in general.  I'm going to re-do the tables so that it better supports this.  This will then start the version 2.

File Contents

# Content
1 """
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 main_app_system(id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name TEXT, short_name TEXT, relative_file_path TEXT)""")
16
17 cursor.execute("""CREATE TABLE no_intro_system(id INTEGER NOT NULL PRIMARY KEY, name TEXT, description TEXT, dat_version TEXT)""")
18
19
20 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) )""")
21
22 cursor.execute("""CREATE TABLE tosec_main (game_name TEXT, description TEXT, rom_name TEXT, crc TEXT, md5 TEXT, sha1 TEXT, system_id INTEGER NOT NULL, FOREIGN KEY (system_id) REFERENCES no_intro_system(id) )""")
23
24
25 conn.commit()