mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-23 01:50:00 +00:00
Merge branch 'comments' of nyaadevgithub:nyaadevs/nyaa
This commit is contained in:
commit
c6d4803e90
|
@ -23,7 +23,7 @@ def upgrade():
|
||||||
sa.Column('torrent_id', sa.Integer(), nullable=False),
|
sa.Column('torrent_id', sa.Integer(), nullable=False),
|
||||||
sa.Column('user_id', sa.Integer(), nullable=True),
|
sa.Column('user_id', sa.Integer(), nullable=True),
|
||||||
sa.Column('created_time', sa.DateTime(), nullable=True),
|
sa.Column('created_time', sa.DateTime(), nullable=True),
|
||||||
sa.Column('text', sa.String(length=255), nullable=False),
|
sa.Column('text', sa.String(length=255, collation='utf8mb4_bin'), nullable=False),
|
||||||
sa.ForeignKeyConstraint(['torrent_id'], ['nyaa_torrents.id'], ondelete='CASCADE'),
|
sa.ForeignKeyConstraint(['torrent_id'], ['nyaa_torrents.id'], ondelete='CASCADE'),
|
||||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='CASCADE'),
|
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='CASCADE'),
|
||||||
sa.PrimaryKeyConstraint('id')
|
sa.PrimaryKeyConstraint('id')
|
||||||
|
@ -33,7 +33,7 @@ def upgrade():
|
||||||
sa.Column('torrent_id', sa.Integer(), nullable=False),
|
sa.Column('torrent_id', sa.Integer(), nullable=False),
|
||||||
sa.Column('user_id', sa.Integer(), nullable=True),
|
sa.Column('user_id', sa.Integer(), nullable=True),
|
||||||
sa.Column('created_time', sa.DateTime(), nullable=True),
|
sa.Column('created_time', sa.DateTime(), nullable=True),
|
||||||
sa.Column('text', sa.String(length=255), nullable=False),
|
sa.Column('text', sa.String(length=255, collation='utf8mb4_bin'), nullable=False),
|
||||||
sa.ForeignKeyConstraint(['torrent_id'], ['sukebei_torrents.id'], ondelete='CASCADE'),
|
sa.ForeignKeyConstraint(['torrent_id'], ['sukebei_torrents.id'], ondelete='CASCADE'),
|
||||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='CASCADE'),
|
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='CASCADE'),
|
||||||
sa.PrimaryKeyConstraint('id')
|
sa.PrimaryKeyConstraint('id')
|
||||||
|
|
|
@ -329,7 +329,7 @@ class Comment(db.Model):
|
||||||
DB_TABLE_PREFIX + 'torrents.id', ondelete='CASCADE'), nullable=False)
|
DB_TABLE_PREFIX + 'torrents.id', ondelete='CASCADE'), nullable=False)
|
||||||
user_id = db.Column(db.Integer, db.ForeignKey('users.id', ondelete='CASCADE'))
|
user_id = db.Column(db.Integer, db.ForeignKey('users.id', ondelete='CASCADE'))
|
||||||
created_time = db.Column(db.DateTime(timezone=False), default=datetime.utcnow)
|
created_time = db.Column(db.DateTime(timezone=False), default=datetime.utcnow)
|
||||||
text = db.Column(db.String(length=255), nullable=False)
|
text = db.Column(db.String(length=255, collation=COL_UTF8MB4_BIN), nullable=False)
|
||||||
|
|
||||||
user = db.relationship('User', uselist=False, back_populates='comments', lazy="joined")
|
user = db.relationship('User', uselist=False, back_populates='comments', lazy="joined")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue