|
|
|
import flask_sqlalchemy
|
|
|
|
|
|
|
|
|
|
|
|
db = flask_sqlalchemy.SQLAlchemy()
|
|
|
|
|
|
|
|
|
|
|
|
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)
|