|
| 1 | +"""feat: jmy |
| 2 | +
|
| 3 | +Revision ID: 7d6aa6eaf640 |
| 4 | +Revises: 0bdf3abd5213 |
| 5 | +Create Date: 2025-03-05 00:15:09.139612 |
| 6 | +
|
| 7 | +""" |
| 8 | +from typing import Sequence, Union |
| 9 | + |
| 10 | +from alembic import op |
| 11 | +import sqlalchemy as sa |
| 12 | + |
| 13 | + |
| 14 | +# revision identifiers, used by Alembic. |
| 15 | +revision: str = '7d6aa6eaf640' |
| 16 | +down_revision: Union[str, None] = '0bdf3abd5213' |
| 17 | +branch_labels: Union[str, Sequence[str], None] = None |
| 18 | +depends_on: Union[str, Sequence[str], None] = None |
| 19 | + |
| 20 | + |
| 21 | +def upgrade() -> None: |
| 22 | + # ### commands auto generated by Alembic - please adjust! ### |
| 23 | + op.create_table('jmy_company', |
| 24 | + sa.Column('name', sa.String(length=255), nullable=False), |
| 25 | + sa.Column('year', sa.Integer(), nullable=False), |
| 26 | + sa.Column('location', sa.String(length=255), nullable=False), |
| 27 | + sa.Column('address', sa.String(length=255), nullable=False), |
| 28 | + sa.Column('type', sa.String(length=255), nullable=False), |
| 29 | + sa.Column('size', sa.String(length=255), nullable=False), |
| 30 | + sa.Column('research', sa.String(length=255), nullable=True), |
| 31 | + sa.Column('id', sa.Integer(), nullable=False), |
| 32 | + sa.Column('created_at', sa.DateTime(timezone=True), nullable=False), |
| 33 | + sa.Column('updated_at', sa.DateTime(timezone=True), nullable=False), |
| 34 | + sa.PrimaryKeyConstraint('id') |
| 35 | + ) |
| 36 | + op.create_table('jmy_time_series', |
| 37 | + sa.Column('company_id', sa.Integer(), nullable=False), |
| 38 | + sa.Column('date', sa.DateTime(timezone=True), nullable=False), |
| 39 | + sa.Column('b_assigned', sa.Integer(), nullable=False), |
| 40 | + sa.Column('b_new', sa.Integer(), nullable=False), |
| 41 | + sa.Column('b_old', sa.Integer(), nullable=False), |
| 42 | + sa.Column('a_assigned', sa.Integer(), nullable=False), |
| 43 | + sa.Column('a_new', sa.Integer(), nullable=False), |
| 44 | + sa.Column('a_old', sa.Integer(), nullable=False), |
| 45 | + sa.Column('id', sa.Integer(), nullable=False), |
| 46 | + sa.Column('created_at', sa.DateTime(timezone=True), nullable=False), |
| 47 | + sa.Column('updated_at', sa.DateTime(timezone=True), nullable=False), |
| 48 | + sa.ForeignKeyConstraint(['company_id'], ['jmy_company.id'], ), |
| 49 | + sa.PrimaryKeyConstraint('id') |
| 50 | + ) |
| 51 | + # ### end Alembic commands ### |
| 52 | + |
| 53 | + |
| 54 | +def downgrade() -> None: |
| 55 | + # ### commands auto generated by Alembic - please adjust! ### |
| 56 | + op.drop_table('jmy_time_series') |
| 57 | + op.drop_table('jmy_company') |
| 58 | + # ### end Alembic commands ### |
0 commit comments