Closed mazziechai closed 3 years ago
PRAGMA foreign_keys = off; BEGIN TRANSACTION; CREATE TABLE guild_settings ( id BIGINT PRIMARY KEY ON CONFLICT ROLLBACK, prefix TEXT NOT NULL DEFAULT [;] ); CREATE TABLE matches ( id INTEGER PRIMARY KEY ON CONFLICT ROLLBACK, rating_period INTEGER REFERENCES rating_periods (id), player1 BIGINT REFERENCES players (id) NOT NULL, player2 BIGINT REFERENCES players (id) NOT NULL, in_progress BOOLEAN NOT NULL, completed BOOLEAN NOT NULL, player1_score INTEGER, player2_score INTEGER, start_time DATETIME, end_time DATETIME ); CREATE TABLE players ( id BIGINT PRIMARY KEY ON CONFLICT ROLLBACK, display_name TEXT UNIQUE ON CONFLICT ROLLBACK, rating DOUBLE NOT NULL, rating_deviation DOUBLE NOT NULL, volatility DOUBLE NOT NULL ); CREATE TABLE rating_periods ( id INTEGER PRIMARY KEY ON CONFLICT ROLLBACK, start_time DATETIME NOT NULL ); COMMIT TRANSACTION; PRAGMA foreign_keys = on;
Recent pull request successfully implemented basic SQLAlchemy database with Hiku's World Ranking dataset as an example for future testing and experimentation.
SQL representation of the database structure