This commit is contained in:
Kenneth Kehl
2023-08-29 14:54:30 -07:00
parent 19dcd7a48b
commit 1ecb747c6d
588 changed files with 34091 additions and 23580 deletions
@@ -9,28 +9,39 @@ from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
revision = '0179_billing_primary_const'
down_revision = '0178_add_filename'
revision = "0179_billing_primary_const"
down_revision = "0178_add_filename"
def upgrade():
op.drop_column('ft_billing', 'crown')
op.drop_column('ft_billing', 'annual_billing_id')
op.drop_column('ft_billing', 'organisation_id')
op.drop_constraint('ft_billing_pkey', 'ft_billing', type_='primary')
op.drop_column("ft_billing", "crown")
op.drop_column("ft_billing", "annual_billing_id")
op.drop_column("ft_billing", "organisation_id")
op.drop_constraint("ft_billing_pkey", "ft_billing", type_="primary")
# These are the orthogonal dimensions that define a row (except international).
# These entries define a unique record.
op.create_primary_key('ft_billing_pkey', 'ft_billing', ['bst_date',
'template_id',
'rate_multiplier',
'provider',
'international'])
op.create_primary_key(
"ft_billing_pkey",
"ft_billing",
["bst_date", "template_id", "rate_multiplier", "provider", "international"],
)
def downgrade():
op.add_column('ft_billing', sa.Column('organisation_id', postgresql.UUID(), autoincrement=False, nullable=True))
op.add_column('ft_billing', sa.Column('annual_billing_id', postgresql.UUID(), autoincrement=False, nullable=True))
op.add_column('ft_billing', sa.Column('crown', sa.TEXT(), autoincrement=False, nullable=True))
op.drop_constraint('ft_billing_pkey', 'ft_billing', type_='primary')
op.create_primary_key('ft_billing_pkey', 'ft_billing', ['bst_date',
'template_id'])
op.add_column(
"ft_billing",
sa.Column(
"organisation_id", postgresql.UUID(), autoincrement=False, nullable=True
),
)
op.add_column(
"ft_billing",
sa.Column(
"annual_billing_id", postgresql.UUID(), autoincrement=False, nullable=True
),
)
op.add_column(
"ft_billing", sa.Column("crown", sa.TEXT(), autoincrement=False, nullable=True)
)
op.drop_constraint("ft_billing_pkey", "ft_billing", type_="primary")
op.create_primary_key("ft_billing_pkey", "ft_billing", ["bst_date", "template_id"])