-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a9c3a4
commit bc50f26
Showing
3 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"""Added date indexes | ||
Revision ID: c5f1b8431345 | ||
Revises: 85eecf551f0e | ||
Create Date: 2024-06-25 21:23:39.365717 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = 'c5f1b8431345' | ||
down_revision: Union[str, None] = '85eecf551f0e' | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('entries', schema=None) as batch_op: | ||
batch_op.create_index(batch_op.f('ix_entries_created'), ['created'], unique=False) | ||
batch_op.create_index(batch_op.f('ix_entries_sort_date'), ['sort_date'], unique=False) | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('entries', schema=None) as batch_op: | ||
batch_op.drop_index(batch_op.f('ix_entries_sort_date')) | ||
batch_op.drop_index(batch_op.f('ix_entries_created')) | ||
|
||
# ### end Alembic commands ### |