You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.8 KiB

import flask_sqlalchemy
db = flask_sqlalchemy.SQLAlchemy(session_options=dict(autoflush=False))
class Video(db.Model):
__tablename__ = 'videos'
id = db.Column(db.Integer, primary_key=True)
broadcast_type = db.Column(db.String)
title = db.Column(db.String)
description = db.Column(db.String)
game = db.Column(db.String)
length = db.Column(db.Integer)
thumbnail_small = db.Column(db.String)
thumbnail_medium = db.Column(db.String)
thumbnail_large = db.Column(db.String)
created_at = db.Column(db.DateTime)
updated_at = db.Column(db.DateTime)
recorded_at = db.Column(db.DateTime)
published_at = db.Column(db.DateTime)
associations = db.relationship('Association', backref='video')
class Comment(db.Model):
__tablename__ = 'comments'
id = db.Column(db.String, primary_key=True)
commenter_id = db.Column(db.Integer)
commenter_name = db.Column(db.String)
commenter_display_name = db.Column(db.String)
commenter_logo = db.Column(db.String)
source = db.Column(db.String)
message_body = db.Column(db.String)
message_user_color = db.Column(db.String)
message_user_badges = db.Column(db.String)
created_at = db.Column(db.DateTime)
updated_at = db.Column(db.DateTime)
class Association(db.Model):
__tablename__ = 'association'
video_id = db.Column(db.Integer, db.ForeignKey('videos.id'), primary_key=True)
comment_id = db.Column(db.String, db.ForeignKey('comments.id'), primary_key=True)
offset = db.Column(db.Float)
comment = db.relationship('Comment')
class Emote(db.Model):
__tablename__ = 'emotes'
id = db.Column(db.Integer, primary_key=True)
code = db.Column(db.String)
class Clip(db.Model):
__tablename__ = 'clips'
slug = db.Column(db.String, primary_key=True)
video_id = db.Column(db.Integer)
video_offset = db.Column(db.Float)
title = db.Column(db.String)
game = db.Column(db.String)
duration = db.Column(db.Float)
curator_id = db.Column(db.Integer)
curator_name = db.Column(db.String)
curator_display_name = db.Column(db.String)
curator_logo = db.Column(db.String)
thumbnail_tiny = db.Column(db.String)
thumbnail_small = db.Column(db.String)
thumbnail_medium = db.Column(db.String)
created_at = db.Column(db.DateTime)
class Event(db.Model):
__tablename__ = 'events'
id = db.Column(db.String, primary_key=True)
start = db.Column(db.DateTime)
end = db.Column(db.DateTime)
title = db.Column(db.String)
description = db.Column(db.String)
cover_image_id = db.Column(db.String)
cover_image_url = db.Column(db.String)
game_id = db.Column(db.Integer)
game_name = db.Column(db.String)
game_box_small = db.Column(db.String)
game_box_medium = db.Column(db.String)
game_box_large = db.Column(db.String)