mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-09 16:19:50 -04:00
reformat
This commit is contained in:
@@ -7,8 +7,8 @@ Create Date: 2017-07-10 14:25:58.494636
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '0107_drop_template_stats'
|
||||
down_revision = '0106_null_noti_status'
|
||||
revision = "0107_drop_template_stats"
|
||||
down_revision = "0106_null_noti_status"
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
@@ -16,23 +16,36 @@ from sqlalchemy.dialects import postgresql
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.drop_table('template_statistics')
|
||||
op.drop_column('service_permissions', 'updated_at')
|
||||
op.drop_table("template_statistics")
|
||||
op.drop_column("service_permissions", "updated_at")
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.add_column('service_permissions',
|
||||
sa.Column('updated_at', postgresql.TIMESTAMP(), autoincrement=False, nullable=True))
|
||||
op.create_table('template_statistics',
|
||||
sa.Column('id', postgresql.UUID(), autoincrement=False, nullable=False),
|
||||
sa.Column('service_id', postgresql.UUID(), autoincrement=False, nullable=False),
|
||||
sa.Column('template_id', postgresql.UUID(), autoincrement=False, nullable=False),
|
||||
sa.Column('usage_count', sa.BIGINT(), autoincrement=False, nullable=False),
|
||||
sa.Column('day', sa.DATE(), autoincrement=False, nullable=False),
|
||||
sa.Column('updated_at', postgresql.TIMESTAMP(), autoincrement=False, nullable=False),
|
||||
sa.ForeignKeyConstraint(['service_id'], ['services.id'],
|
||||
name='template_statistics_service_id_fkey'),
|
||||
sa.ForeignKeyConstraint(['template_id'], ['templates.id'],
|
||||
name='template_statistics_template_id_fkey'),
|
||||
sa.PrimaryKeyConstraint('id', name='template_statistics_pkey')
|
||||
)
|
||||
op.add_column(
|
||||
"service_permissions",
|
||||
sa.Column(
|
||||
"updated_at", postgresql.TIMESTAMP(), autoincrement=False, nullable=True
|
||||
),
|
||||
)
|
||||
op.create_table(
|
||||
"template_statistics",
|
||||
sa.Column("id", postgresql.UUID(), autoincrement=False, nullable=False),
|
||||
sa.Column("service_id", postgresql.UUID(), autoincrement=False, nullable=False),
|
||||
sa.Column(
|
||||
"template_id", postgresql.UUID(), autoincrement=False, nullable=False
|
||||
),
|
||||
sa.Column("usage_count", sa.BIGINT(), autoincrement=False, nullable=False),
|
||||
sa.Column("day", sa.DATE(), autoincrement=False, nullable=False),
|
||||
sa.Column(
|
||||
"updated_at", postgresql.TIMESTAMP(), autoincrement=False, nullable=False
|
||||
),
|
||||
sa.ForeignKeyConstraint(
|
||||
["service_id"], ["services.id"], name="template_statistics_service_id_fkey"
|
||||
),
|
||||
sa.ForeignKeyConstraint(
|
||||
["template_id"],
|
||||
["templates.id"],
|
||||
name="template_statistics_template_id_fkey",
|
||||
),
|
||||
sa.PrimaryKeyConstraint("id", name="template_statistics_pkey"),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user