This repository has been archived on 2023-10-01. You can view files and clone it, but cannot push or open issues or pull requests.
PyNyaaTa/models.py

28 lines
1.1 KiB
Python
Raw Normal View History

2019-11-29 14:04:32 +00:00
from config import db
2019-11-25 21:52:22 +00:00
class AnimeFolder(db.Model):
id = db.Column(db.Integer, primary_key=True)
2020-03-21 18:03:57 +00:00
name = db.Column(db.String(length=100, collation='utf8mb4_general_ci'), unique=True, nullable=False)
2019-11-30 22:42:35 +00:00
titles = db.relationship("AnimeTitle", backref="folder")
2019-11-25 21:52:22 +00:00
class AnimeTitle(db.Model):
id = db.Column(db.Integer, primary_key=True)
2020-03-21 18:03:57 +00:00
name = db.Column(db.String(length=100, collation='utf8mb4_general_ci'), unique=True, nullable=False)
2019-12-15 12:02:13 +00:00
keyword = db.Column(db.Text(collation='utf8mb4_general_ci'), nullable=False)
2019-11-30 22:42:35 +00:00
folder_id = db.Column(db.Integer, db.ForeignKey('anime_folder.id'))
links = db.relationship('AnimeLink', backref="title")
2019-11-25 21:52:22 +00:00
class AnimeLink(db.Model):
id = db.Column(db.Integer, primary_key=True)
2019-12-15 12:02:13 +00:00
link = db.Column(db.Text(collation='utf8mb4_general_ci'), nullable=False)
season = db.Column(db.Text(collation='utf8mb4_general_ci'), nullable=False)
comment = db.Column(db.Text(collation='utf8mb4_general_ci'))
2019-11-25 21:52:22 +00:00
vf = db.Column(db.Boolean, nullable=False)
2019-11-30 22:42:35 +00:00
title_id = db.Column(db.Integer, db.ForeignKey('anime_title.id'))
2019-11-29 14:04:32 +00:00
2019-11-30 22:42:35 +00:00
db.create_all()