Skip to content

Commit

Permalink
Use server_default for pinned article migration
Browse files Browse the repository at this point in the history
Theoretically this should work, since default wasn't working. Other
options include making the column nullable, setting a value, then making
it not nullable. This is kind of obnoxious really.
  • Loading branch information
mutantmonkey committed Apr 25, 2024
1 parent f593e45 commit 7b99628
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions migrations/versions/28e9e049850c_add_pinned_articles.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import sqlalchemy as sa

def upgrade():
op.add_column("article", sa.Column("pinned_article", sa.Boolean(), nullable=False, default=False))
op.add_column("article_revision", sa.Column("pinned_article", sa.Boolean(), nullable=False, default=False))
op.add_column("article", sa.Column("pinned_article", sa.Boolean(), nullable=False, server_default=False))
op.add_column("article_revision", sa.Column("pinned_article", sa.Boolean(), nullable=False, server_default=False))
pass


Expand Down

0 comments on commit 7b99628

Please sign in to comment.