From 7b7f9f466495d6c04292f3d0ecc371622e6f98e5 Mon Sep 17 00:00:00 2001 From: freamon Date: Thu, 23 May 2024 14:19:23 +0100 Subject: [PATCH] DB upgrade: new Instance.nodeinfo_href column --- app/models.py | 1 + .../dfba54bdaeb2_instance_nodeinfo_href.py | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 migrations/versions/dfba54bdaeb2_instance_nodeinfo_href.py diff --git a/app/models.py b/app/models.py index 942fab42..e817f3f5 100644 --- a/app/models.py +++ b/app/models.py @@ -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') diff --git a/migrations/versions/dfba54bdaeb2_instance_nodeinfo_href.py b/migrations/versions/dfba54bdaeb2_instance_nodeinfo_href.py new file mode 100644 index 00000000..ea0c1684 --- /dev/null +++ b/migrations/versions/dfba54bdaeb2_instance_nodeinfo_href.py @@ -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 ###