This commit is contained in:
Bryce
2025-08-03 21:35:22 -07:00
parent 21d3a710f2
commit 9df259eb58
26 changed files with 476 additions and 363 deletions

View File

@@ -1,28 +1,25 @@
"""Initial migration with users and folders tables
"""initial
Revision ID: 1f23b4f802b0
Revision ID: 02a7c13515a4
Revises:
Create Date: 2025-08-03 08:30:06.300965
Create Date: 2025-08-03 21:33:28.507003
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '1f23b4f802b0'
down_revision: Union[str, Sequence[str], None] = None
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
revision = '02a7c13515a4'
down_revision = None
branch_labels = None
depends_on = None
def upgrade() -> None:
"""Upgrade schema."""
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('users',
sa.Column('id', sa.UUID(), nullable=False),
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('email', sa.String(length=255), nullable=False),
sa.Column('password_hash', sa.LargeBinary(), nullable=True),
sa.Column('imap_config', sa.JSON(), nullable=True),
@@ -30,8 +27,8 @@ def upgrade() -> None:
sa.UniqueConstraint('email')
)
op.create_table('folders',
sa.Column('id', sa.UUID(), nullable=False),
sa.Column('user_id', sa.UUID(), nullable=False),
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=255), nullable=False),
sa.Column('rule_text', sa.Text(), nullable=True),
sa.Column('priority', sa.Integer(), nullable=True),
@@ -41,8 +38,7 @@ def upgrade() -> None:
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('folders')
op.drop_table('users')