Instead of deleting the data in the name field just copy it to the text field.

The admin app still needs to use the name column.
Add the text field to the post data schemas.
If the text is not in the post data, then populate it with the data in the name field.
This should make the migration to text easier, and will work until we are able to update the admin app.
This commit is contained in:
Rebecca Law
2018-08-02 15:55:45 +01:00
parent 4345771547
commit c30e58eaad
4 changed files with 76 additions and 6 deletions

View File

@@ -14,14 +14,9 @@ down_revision = '0210_remove_monthly_billing'
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('email_branding', sa.Column('text', sa.String(length=255), nullable=True))
op.execute('UPDATE email_branding SET text = name')
op.execute('UPDATE email_branding SET name = NULL')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.execute('UPDATE email_branding SET name = text')
op.drop_column('email_branding', 'text')
# ### end Alembic commands ###