Some checks failed
Create and publish Docker images with specific build args / build-main-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-main-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda126-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda126-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Create and publish Docker images with specific build args / build-ollama-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-ollama-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Create and publish Docker images with specific build args / build-slim-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-slim-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Create and publish Docker images with specific build args / merge-main-images (push) Has been cancelled
Create and publish Docker images with specific build args / merge-cuda-images (push) Has been cancelled
Create and publish Docker images with specific build args / merge-cuda126-images (push) Has been cancelled
Create and publish Docker images with specific build args / merge-ollama-images (push) Has been cancelled
Create and publish Docker images with specific build args / merge-slim-images (push) Has been cancelled
Python CI / Format Backend (3.11.x) (push) Has been cancelled
Python CI / Format Backend (3.12.x) (push) Has been cancelled
Frontend Build / Format & Build Frontend (push) Has been cancelled
Frontend Build / Frontend Unit Tests (push) Has been cancelled
Close inactive issues / close-issues (push) Has been cancelled
49 lines
1.8 KiB
Python
49 lines
1.8 KiB
Python
"""init redemption
|
|
|
|
Revision ID: 97c08d196e3d
|
|
Revises: d31026856c01
|
|
Create Date: 2025-08-11 16:17:17.746993
|
|
|
|
"""
|
|
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
import open_webui.internal.db
|
|
from sqlalchemy.dialects import sqlite
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = "97c08d196e3d"
|
|
down_revision: Union[str, None] = "d31026856c01"
|
|
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(
|
|
"redemption_code",
|
|
sa.Column("code", sa.String(), nullable=False),
|
|
sa.Column("purpose", sa.String(), nullable=True),
|
|
sa.Column("user_id", sa.String(), nullable=True),
|
|
sa.Column("amount", sa.Numeric(precision=24, scale=12), nullable=True),
|
|
sa.Column("created_at", sa.BigInteger(), nullable=True),
|
|
sa.Column("expired_at", sa.BigInteger(), nullable=True),
|
|
sa.Column("received_at", sa.BigInteger(), nullable=True),
|
|
sa.PrimaryKeyConstraint("code"),
|
|
)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_index("function_id", "function", ["id"], unique=1)
|
|
op.drop_index(op.f("ix_redemption_code_user_id"), table_name="redemption_code")
|
|
op.drop_index(op.f("ix_redemption_code_received_at"), table_name="redemption_code")
|
|
op.drop_index(op.f("ix_redemption_code_purpose"), table_name="redemption_code")
|
|
op.drop_index(op.f("ix_redemption_code_expired_at"), table_name="redemption_code")
|
|
op.drop_index(op.f("ix_redemption_code_created_at"), table_name="redemption_code")
|
|
op.drop_table("redemption_code")
|
|
# ### end Alembic commands ###
|