DB upgrade: new Instance.nodeinfo_href column

This commit is contained in:
freamon 2024-05-23 14:19:23 +01:00
parent 71ed6fc7af
commit 7b7f9f4664
2 changed files with 33 additions and 0 deletions

View file

@ -68,6 +68,7 @@ class Instance(db.Model):
ip_address = db.Column(db.String(50))
trusted = db.Column(db.Boolean, default=False)
posting_warning = db.Column(db.String(512))
nodeinfo_href = db.Column(db.String(100))
posts = db.relationship('Post', backref='instance', lazy='dynamic')
post_replies = db.relationship('PostReply', backref='instance', lazy='dynamic')

View file

@ -0,0 +1,32 @@
"""instance nodeinfo href
Revision ID: dfba54bdaeb2
Revises: a32b474a40dd
Create Date: 2024-05-23 14:14:11.293845
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'dfba54bdaeb2'
down_revision = 'a32b474a40dd'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('instance', schema=None) as batch_op:
batch_op.add_column(sa.Column('nodeinfo_href', sa.String(length=100), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('instance', schema=None) as batch_op:
batch_op.drop_column('nodeinfo_href')
# ### end Alembic commands ###