mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-01 03:41:31 +00:00
Implement database & model hashing
This commit is contained in:
34
alembic_db/versions/565b08122d00_init.py
Normal file
34
alembic_db/versions/565b08122d00_init.py
Normal file
@@ -0,0 +1,34 @@
|
||||
"""init
|
||||
|
||||
Revision ID: 565b08122d00
|
||||
Revises:
|
||||
Create Date: 2025-05-29 19:15:56.230322
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '565b08122d00'
|
||||
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:
|
||||
"""Upgrade schema."""
|
||||
op.create_table('model',
|
||||
sa.Column('type', sa.Text(), nullable=False),
|
||||
sa.Column('path', sa.Text(), nullable=False),
|
||||
sa.Column('hash', sa.Text(), nullable=True),
|
||||
sa.Column('date_added', sa.DateTime(), server_default=sa.text('(CURRENT_TIMESTAMP)'), nullable=True),
|
||||
sa.PrimaryKeyConstraint('type', 'path')
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
op.drop_table('model')
|
||||
Reference in New Issue
Block a user