Not null the provider column on the inbound SMS table.

This commit is contained in:
Martyn Inglis
2017-06-02 16:51:27 +01:00
parent 199c43c507
commit 400096520d
2 changed files with 27 additions and 1 deletions

View File

@@ -1166,7 +1166,7 @@ class InboundSms(db.Model):
user_number = db.Column(db.String, nullable=False) # the end user's number, that the msg was sent from
provider_date = db.Column(db.DateTime)
provider_reference = db.Column(db.String)
provider = db.Column(db.String, nullable=True)
provider = db.Column(db.String, nullable=False)
_content = db.Column('content', db.String, nullable=False)
@property

View File

@@ -0,0 +1,26 @@
"""empty message
Revision ID: 0093_notnull_inbound_provider
Revises: 0092_populate_inbound_provider
Create Date: 2017-06-02 16:50:11.698423
"""
# revision identifiers, used by Alembic.
revision = '0093_notnull_inbound_provider'
down_revision = '0092_populate_inbound_provider'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.alter_column('inbound_sms', 'provider',
existing_type=sa.VARCHAR(),
nullable=False)
def downgrade():
op.alter_column('inbound_sms', 'provider',
existing_type=sa.VARCHAR(),
nullable=True)