|
| 1 | +"""Add Freebie Model |
| 2 | +
|
| 3 | +Revision ID: cbfc11270a30 |
| 4 | +Revises: 5f72c58bf48c |
| 5 | +Create Date: 2023-12-10 17:19:02.371520 |
| 6 | +
|
| 7 | +""" |
| 8 | +from alembic import op |
| 9 | +import sqlalchemy as sa |
| 10 | + |
| 11 | + |
| 12 | +# revision identifiers, used by Alembic. |
| 13 | +revision = 'cbfc11270a30' |
| 14 | +down_revision = '5f72c58bf48c' |
| 15 | +branch_labels = None |
| 16 | +depends_on = None |
| 17 | + |
| 18 | + |
| 19 | +def upgrade() -> None: |
| 20 | + # ### commands auto generated by Alembic - please adjust! ### |
| 21 | + op.create_table('company_devs', |
| 22 | + sa.Column('company_id', sa.Integer(), nullable=False), |
| 23 | + sa.Column('dev_id', sa.Integer(), nullable=False), |
| 24 | + sa.ForeignKeyConstraint(['company_id'], ['companies.id'], name=op.f('fk_company_devs_company_id_companies')), |
| 25 | + sa.ForeignKeyConstraint(['dev_id'], ['devs.id'], name=op.f('fk_company_devs_dev_id_devs')), |
| 26 | + sa.PrimaryKeyConstraint('company_id', 'dev_id') |
| 27 | + ) |
| 28 | + op.create_table('freebies', |
| 29 | + sa.Column('id', sa.Integer(), nullable=False), |
| 30 | + sa.Column('item_name', sa.String(), nullable=True), |
| 31 | + sa.Column('value', sa.Integer(), nullable=True), |
| 32 | + sa.Column('company_id', sa.Integer(), nullable=True), |
| 33 | + sa.Column('dev_id', sa.Integer(), nullable=True), |
| 34 | + sa.ForeignKeyConstraint(['company_id'], ['companies.id'], name=op.f('fk_freebies_company_id_companies')), |
| 35 | + sa.ForeignKeyConstraint(['dev_id'], ['devs.id'], name=op.f('fk_freebies_dev_id_devs')), |
| 36 | + sa.PrimaryKeyConstraint('id') |
| 37 | + ) |
| 38 | + # ### end Alembic commands ### |
| 39 | + |
| 40 | + |
| 41 | +def downgrade() -> None: |
| 42 | + # ### commands auto generated by Alembic - please adjust! ### |
| 43 | + op.drop_table('freebies') |
| 44 | + op.drop_table('company_devs') |
| 45 | + # ### end Alembic commands ### |
0 commit comments