Skip to content

Commit

Permalink
Refs FedStoa#108 - Add storage for conditional posting via faves
Browse files Browse the repository at this point in the history
I don't know the correct way to reserve a migration ID, so I've named
this `abcdef012345`. Guidance welcome.

Also I expect to rename the existing `conditional_posting` storage,
because it will be confusingly named if this new conditional posting
method is added.
  • Loading branch information
xurizaemon committed Mar 11, 2019
1 parent fad8fc1 commit f38b846
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions migrations/versions/abcdef012345_conditional_posting_with_faves.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""empty message
Revision ID: abcdef012345
Revises: 52a6ff8551e1
Create Date: 2019-03-10 20:44:12.345678
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'abcdef012345'
down_revision = '52a6ff8551e1'
branch_labels = None
depends_on = None


def upgrade():
## Rename existing conditional_posting column for clarity.
# op.alter_column('settings', 'conditional_posting', new_column_name='conditional_posting_hashtags')
op.add_column('settings', sa.Column('conditional_posting_faves', sa.Boolean(), nullable=False))


def downgrade():
## Should be dropped in dc37a95190f6, provided it's correctly renamed back.
# op.alter_column('settings', 'conditional_posting_hashtags', new_column_name='conditional_posting')
op.drop_column('settings', 'conditional_posting_faves')

0 comments on commit f38b846

Please sign in to comment.