-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added avg as a column for both SqlaTable and Druid
- Loading branch information
Showing
2 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
caravel/migrations/versions/ad4d656d92bc_add_avg_metric.py
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,25 @@ | ||
"""Add avg() to default metrics | ||
Revision ID: ad4d656d92bc | ||
Revises: b46fa1b0b39e | ||
Create Date: 2016-10-25 10:16:39.871078 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'ad4d656d92bc' | ||
down_revision = '7e3ddad2a00b' | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
def upgrade(): | ||
op.add_column('columns', sa.Column('avg', sa.Boolean(), nullable=True)) | ||
op.add_column('table_columns', sa.Column('avg', sa.Boolean(), nullable=True)) | ||
|
||
def downgrade(): | ||
with op.batch_alter_table('columns') as batch_op: | ||
batch_op.drop_column('avg') | ||
with op.batch_alter_table('table_columns') as batch_op: | ||
batch_op.drop_column('avg') |
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