2018-05-21 14:38:25 +01:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
Revision ID: 0191_ft_billing_pkey
|
2023-07-17 10:26:23 -07:00
|
|
|
Revises: 0189_ft_billing_data
|
2018-05-21 14:38:25 +01:00
|
|
|
Create Date: 2018-05-21 14:24:27.229511
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
from alembic import op
|
|
|
|
|
|
|
|
|
|
revision = '0191_ft_billing_pkey'
|
2023-07-17 10:26:23 -07:00
|
|
|
down_revision = '0189_ft_billing_data_type'
|
2018-05-21 14:38:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def upgrade():
|
|
|
|
|
op.get_bind()
|
|
|
|
|
op.execute("ALTER TABLE ft_billing DROP CONSTRAINT ft_billing_pkey")
|
|
|
|
|
sql = """ALTER TABLE ft_billing ADD CONSTRAINT
|
|
|
|
|
ft_billing_pkey PRIMARY KEY
|
|
|
|
|
(bst_date, template_id, service_id, rate_multiplier, provider, notification_type, international, rate)"""
|
|
|
|
|
op.execute(sql)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def downgrade():
|
|
|
|
|
op.get_bind()
|
|
|
|
|
op.execute("ALTER TABLE ft_billing DROP CONSTRAINT ft_billing_pkey")
|
|
|
|
|
sql = """ALTER TABLE ft_billing ADD CONSTRAINT
|
|
|
|
|
ft_billing_pkey PRIMARY KEY
|
|
|
|
|
(bst_date, template_id, service_id, rate_multiplier, provider, notification_type, international)"""
|
|
|
|
|
op.execute(sql)
|