mirror of
https://github.com/solero/houdini.git
synced 2024-11-12 13:48:20 +00:00
Game save state SQL
This commit is contained in:
parent
b2b3d9c236
commit
23a8147762
16
houdini.sql
16
houdini.sql
@ -1011,15 +1011,15 @@ COMMENT ON COLUMN track_like.track_id IS 'Liked track ID';
|
|||||||
COMMENT ON COLUMN track_like.penguin_id IS 'Liker penguin ID';
|
COMMENT ON COLUMN track_like.penguin_id IS 'Liker penguin ID';
|
||||||
COMMENT ON COLUMN track_like.date IS 'Timestamp of like';
|
COMMENT ON COLUMN track_like.date IS 'Timestamp of like';
|
||||||
|
|
||||||
DROP TABLE IF EXISTS penguin_launch_game;
|
DROP TABLE IF EXISTS penguin_game_data;
|
||||||
CREATE TABLE penguin_launch_game (
|
CREATE TABLE penguin_game_data (
|
||||||
penguin_id INT NOT NULL,
|
penguin_id INT NOT NULL,
|
||||||
level SMALLINT NOT NULL DEFAULT 0,
|
room_id INT NOT NULL,
|
||||||
puffle_os SMALLINT NOT NULL DEFAULT 0,
|
index INT DEFAULT NULL,
|
||||||
best_time SMALLINT NOT NULL DEFAULT 600,
|
data TEXT DEFAULT '',
|
||||||
turbo BOOLEAN NOT NULL DEFAULT FALSE,
|
PRIMARY KEY (penguin_id, room_id, index),
|
||||||
PRIMARY KEY (penguin_id, level),
|
CONSTRAINT penguin_game_data_ibfk_1 FOREIGN KEY (penguin_id) REFERENCES penguin (id) ON DELETE RESTRICT ON UPDATE CASCADE,
|
||||||
CONSTRAINT penguin_launch_game_ibfk_1 FOREIGN KEY (penguin_id) REFERENCES penguin (id) ON DELETE RESTRICT ON UPDATE CASCADE
|
CONSTRAINT penguin_game_data_ibfk_2 FOREIGN KEY (room_id) REFERENCES room (id) ON DELETE RESTRICT ON UPDATE CASCADE
|
||||||
);
|
);
|
||||||
|
|
||||||
DROP TABLE IF EXISTS ignore_list;
|
DROP TABLE IF EXISTS ignore_list;
|
||||||
|
12
houdini/data/game.py
Normal file
12
houdini/data/game.py
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
from houdini.data import db
|
||||||
|
|
||||||
|
|
||||||
|
class PenguinGameData(db.Model):
|
||||||
|
__tablename__ = 'penguin_game_data'
|
||||||
|
|
||||||
|
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='RESTRICT', onupdate='CASCADE'), primary_key=True,
|
||||||
|
nullable=False)
|
||||||
|
room_id = db.Column(db.ForeignKey('room.id', ondelete='RESTRICT', onupdate='CASCADE'), primary_key=True,
|
||||||
|
nullable=False, index=True)
|
||||||
|
index = db.Column(db.Integer, primary_key=True, index=True)
|
||||||
|
data = db.Column(db.Text, nullable=False, server_default=db.text("''"))
|
Loading…
Reference in New Issue
Block a user