Fix schema inconsistencies

This commit is contained in:
Lance Edgar 2023-09-13 09:18:45 -05:00
parent 0d9f0d1daa
commit d6a0d3b090
2 changed files with 38 additions and 1 deletions

View file

@ -0,0 +1,37 @@
# -*- coding: utf-8; -*-
"""fix nullable
Revision ID: 7fc3dee0e9c5
Revises: c3cb75afcae2
Create Date: 2023-09-13 09:12:33.740638
"""
# revision identifiers, used by Alembic.
revision = '7fc3dee0e9c5'
down_revision = 'c3cb75afcae2'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
import rattail.db.types
def upgrade():
# nationbuilder_cache_donation
op.alter_column('nationbuilder_cache_donation_version', 'id',
existing_type=sa.INTEGER(),
nullable=True,
autoincrement=False)
def downgrade():
# nationbuilder_cache_donation
op.alter_column('nationbuilder_cache_donation_version', 'id',
existing_type=sa.INTEGER(),
nullable=False,
autoincrement=False)

View file

@ -51,7 +51,7 @@ class NationBuilderCachePerson(model.Base):
id = sa.Column(sa.Integer(), nullable=False) id = sa.Column(sa.Integer(), nullable=False)
signup_type = sa.Column(sa.Integer(), nullable=True) signup_type = sa.Column(sa.Integer(), nullable=True)
external_id = sa.Column(sa.String(length=50), nullable=True) external_id = sa.Column(sa.String(length=50), nullable=True)
tags = sa.Column(sa.String(length=255), nullable=True) tags = sa.Column(sa.Text(), nullable=True)
first_name = sa.Column(sa.String(length=100), nullable=True) first_name = sa.Column(sa.String(length=100), nullable=True)
middle_name = sa.Column(sa.String(length=100), nullable=True) middle_name = sa.Column(sa.String(length=100), nullable=True)
last_name = sa.Column(sa.String(length=100), nullable=True) last_name = sa.Column(sa.String(length=100), nullable=True)