mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
Remove database default on rate_limit column
The default for the rate_limit column in the services and services_history model is now set in the model, so we can remove the default from the database. Pivotal story: https://www.pivotaltracker.com/story/show/153992529
This commit is contained in:
22
migrations/versions/0158_remove_rate_limit_default.py
Normal file
22
migrations/versions/0158_remove_rate_limit_default.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""
|
||||
|
||||
Revision ID: 0158_remove_rate_limit_default
|
||||
Revises: 0157_add_rate_limit_to_service
|
||||
Create Date: 2018-01-09 14:33:08.313893
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
revision = '0158_remove_rate_limit_default'
|
||||
down_revision = '0157_add_rate_limit_to_service'
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.execute("ALTER TABLE services ALTER rate_limit DROP DEFAULT")
|
||||
op.execute("ALTER TABLE services_history ALTER rate_limit DROP DEFAULT")
|
||||
|
||||
def downgrade():
|
||||
op.execute("ALTER TABLE services ALTER rate_limit SET DEFAULT '3000'")
|
||||
op.execute("ALTER TABLE services_history ALTER rate_limit SET DEFAULT '3000'")
|
||||
Reference in New Issue
Block a user