Browse Source
This is useful to quickly browse a list of polymorphic Posts for topics, programs, etc. The main application is from Member.posts, since polymorphic collection seems both difficult and edgy. [MIGRATION] This commit contains a new version of the schema.master^2
2 changed files with 29 additions and 1 deletions
@ -0,0 +1,28 @@
|
||||
"""Add an index on Post.type |
||||
|
||||
Revision ID: d2227d2479e2 |
||||
Revises: bcfdb271b88d |
||||
Create Date: 2022-04-25 16:44:51.241965 |
||||
|
||||
""" |
||||
from alembic import op |
||||
import sqlalchemy as sa |
||||
|
||||
|
||||
# revision identifiers, used by Alembic. |
||||
revision = 'd2227d2479e2' |
||||
down_revision = 'bcfdb271b88d' |
||||
branch_labels = None |
||||
depends_on = None |
||||
|
||||
|
||||
def upgrade(): |
||||
# ### commands auto generated by Alembic - please adjust! ### |
||||
op.create_index(op.f('ix_post_type'), 'post', ['type'], unique=False) |
||||
# ### end Alembic commands ### |
||||
|
||||
|
||||
def downgrade(): |
||||
# ### commands auto generated by Alembic - please adjust! ### |
||||
op.drop_index(op.f('ix_post_type'), table_name='post') |
||||
# ### end Alembic commands ### |
Loading…
Reference in new issue