initial
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 44b022dca7ce
|
||||
Revises: d64b9935ffd3
|
||||
Create Date: 2024-01-01 16:46:40.302737
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import sqlmodel
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '44b022dca7ce'
|
||||
down_revision: Union[str, None] = 'd64b9935ffd3'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('scan',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('uuid', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
||||
sa.Column('timestamp', sa.Integer(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_index(op.f('ix_scan_timestamp'), 'scan', ['timestamp'], unique=False)
|
||||
op.create_index(op.f('ix_scan_uuid'), 'scan', ['uuid'], unique=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(op.f('ix_scan_uuid'), table_name='scan')
|
||||
op.drop_index(op.f('ix_scan_timestamp'), table_name='scan')
|
||||
op.drop_table('scan')
|
||||
# ### end Alembic commands ###
|
||||
@@ -0,0 +1,30 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 5faf3b4df7ee
|
||||
Revises: 44b022dca7ce
|
||||
Create Date: 2024-01-02 14:01:13.882740
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import sqlmodel
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '5faf3b4df7ee'
|
||||
down_revision: Union[str, None] = '44b022dca7ce'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('medicine', sa.Column('cron', sqlmodel.sql.sqltypes.AutoString(), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('medicine', 'cron')
|
||||
# ### end Alembic commands ###
|
||||
@@ -0,0 +1,54 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: b21476e11a57
|
||||
Revises:
|
||||
Create Date: 2024-01-01 14:11:31.822410
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import sqlmodel
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'b21476e11a57'
|
||||
down_revision: Union[str, None] = None
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('owner',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('name', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('medicine',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('name', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
||||
sa.Column('owner_id', sa.Integer(), nullable=True),
|
||||
sa.Column('pzn', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
||||
sa.Column('uuid', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['owner_id'], ['owner.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_index(op.f('ix_medicine_uuid'), 'medicine', ['uuid'], unique=False)
|
||||
op.create_table('medicinelog',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('medicine_id', sa.Integer(), nullable=True),
|
||||
sa.Column('timestamp', sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['medicine_id'], ['medicine.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('medicinelog')
|
||||
op.drop_index(op.f('ix_medicine_uuid'), table_name='medicine')
|
||||
op.drop_table('medicine')
|
||||
op.drop_table('owner')
|
||||
# ### end Alembic commands ###
|
||||
@@ -0,0 +1,30 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: d64b9935ffd3
|
||||
Revises: b21476e11a57
|
||||
Create Date: 2024-01-01 16:24:12.182247
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import sqlmodel
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'd64b9935ffd3'
|
||||
down_revision: Union[str, None] = 'b21476e11a57'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('medicine', sa.Column('package_size', sa.Integer(), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('medicine', 'package_size')
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user