Skip to content

Commit

Permalink
test: added test case
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeSoft007 committed Aug 11, 2024
1 parent e7ab90a commit f847364
Show file tree
Hide file tree
Showing 13 changed files with 12 additions and 364 deletions.

This file was deleted.

This file was deleted.

30 changes: 0 additions & 30 deletions alembic/versions/2e1bdb317917_added_models_to_support_billing_.py

This file was deleted.

This file was deleted.

30 changes: 0 additions & 30 deletions alembic/versions/95a09b7f5c2c_added_models_to_support_billing_.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""added models to support billing subscription
"""updated billing model ensuing that plan name is unique
Revision ID: 5048f25d8274
Revises: ff92a0037698
Create Date: 2024-08-10 18:15:12.101521
Revision ID: 9a4e3d412f8e
Revises: af8459ffc616
Create Date: 2024-08-11 21:16:54.902038
"""
from typing import Sequence, Union
Expand All @@ -12,8 +12,8 @@


# revision identifiers, used by Alembic.
revision: str = '5048f25d8274'
down_revision: Union[str, None] = 'ff92a0037698'
revision: str = '9a4e3d412f8e'
down_revision: Union[str, None] = 'af8459ffc616'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None

Expand All @@ -23,22 +23,28 @@ def upgrade() -> None:
op.create_table('user_subscriptions',
sa.Column('user_id', sa.String(), nullable=False),
sa.Column('plan_id', sa.String(), nullable=False),
sa.Column('organisation_id', sa.String(), nullable=False),
sa.Column('active', sa.Boolean(), nullable=True),
sa.Column('start_date', sa.String(), nullable=False),
sa.Column('end_date', sa.String(), nullable=True),
sa.Column('id', sa.String(), nullable=False),
sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=True),
sa.Column('updated_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=True),
sa.ForeignKeyConstraint(['organisation_id'], ['organisations.id'], ondelete='CASCADE'),
sa.ForeignKeyConstraint(['plan_id'], ['billing_plans.id'], ondelete='CASCADE'),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_user_subscriptions_id'), 'user_subscriptions', ['id'], unique=False)
op.create_unique_constraint(None, 'billing_plans', ['name'])
op.add_column('user_organisation_roles', sa.Column('status', sa.String(length=20), nullable=False))
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('user_organisation_roles', 'status')
op.drop_constraint(None, 'billing_plans', type_='unique')
op.drop_index(op.f('ix_user_subscriptions_id'), table_name='user_subscriptions')
op.drop_table('user_subscriptions')
# ### end Alembic commands ###

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

26 changes: 0 additions & 26 deletions alembic/versions/cb921ac1eb00_.py

This file was deleted.

Loading

0 comments on commit f847364

Please sign in to comment.