This repository has been archived by the owner on Sep 22, 2023. It is now read-only.
forked from getredash/redash
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from narratorai/index-events
Add indexes to event table
- Loading branch information
Showing
8 changed files
with
146 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
"""add event indexes | ||
Revision ID: 73567079e0f3 | ||
Revises: e5c7a4e2df4d | ||
Create Date: 2020-11-19 16:53:12.180504 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '73567079e0f3' | ||
down_revision = 'e5c7a4e2df4d' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_index(op.f('ix_events_action'), 'events', ['action'], unique=False) | ||
op.create_index('ix_events_created_at_desc', 'events', [sa.text('created_at DESC')], unique=False) | ||
op.create_index(op.f('ix_events_object_id'), 'events', ['object_id'], unique=False) | ||
op.create_index(op.f('ix_events_object_type'), 'events', ['object_type'], unique=False) | ||
op.create_index('ix_events_org_action', 'events', ['org_id', 'action'], unique=False) | ||
op.create_index('ix_events_org_created_at_desc', 'events', ['org_id', sa.text('created_at DESC')], unique=False) | ||
op.create_index(op.f('ix_events_org_id'), 'events', ['org_id'], unique=False) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_index(op.f('ix_events_org_id'), table_name='events') | ||
op.drop_index('ix_events_org_created_at_desc', table_name='events') | ||
op.drop_index('ix_events_org_action', table_name='events') | ||
op.drop_index(op.f('ix_events_object_type'), table_name='events') | ||
op.drop_index(op.f('ix_events_object_id'), table_name='events') | ||
op.drop_index('ix_events_created_at_desc', table_name='events') | ||
op.drop_index(op.f('ix_events_action'), table_name='events') | ||
# ### end Alembic commands ### |
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
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 |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import gevent.monkey | ||
gevent.monkey.patch_all() | ||
# TODO remove this file | ||
|
||
import logging | ||
import os | ||
# import gevent.monkey | ||
# gevent.monkey.patch_all() | ||
|
||
logger = logging.getLogger('redash.gunicorn') | ||
logger.setLevel(logging.INFO) | ||
# import logging | ||
# import os | ||
|
||
# logger = logging.getLogger('redash.gunicorn') | ||
# logger.setLevel(logging.INFO) |
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