Skip to content

Commit

Permalink
database migration
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffVandrewJr committed Dec 27, 2018
1 parent 8f061f5 commit 22c8038
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/main/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from app.main import bp
from app.models import BTCPayClientStore
from flask import redirect, url_for, flash, render_template, request
from flask_blogging.processor import PostProcessor
from flask_blogging_protected import ProtectedPostProcessor
from flask_blogging.views import page_by_id
from flask_login import current_user
from ruamel.yaml import YAML
Expand Down Expand Up @@ -31,7 +31,7 @@ def index():
return redirect(url_for('auth.register'))
response = page_by_id(
post_id=post['post_id'],
slug=PostProcessor.create_slug(post['title'])
slug=ProtectedPostProcessor.create_slug(post['title'])
)
return response

Expand Down
1 change: 1 addition & 0 deletions app/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from app import app, db, login, protected_blog_engine
from flask_blogging import BloggingEngine
from flask_login import UserMixin, current_user
from flask_principal import identity_loaded, RoleNeed
import jwt
Expand Down
30 changes: 30 additions & 0 deletions migrations/versions/6ee795a8d431_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""empty message
Revision ID: 6ee795a8d431
Revises: 14de905dee13
Create Date: 2018-12-26 20:21:49.914278
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '6ee795a8d431'
down_revision = '14de905dee13'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('user', sa.Column('mail_opt_out', sa.Boolean(), nullable=True))
op.create_index(op.f('ix_user_mail_opt_out'), 'user', ['mail_opt_out'], unique=False)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_user_mail_opt_out'), table_name='user')
op.drop_column('user', 'mail_opt_out')
# ### end Alembic commands ###

0 comments on commit 22c8038

Please sign in to comment.