Merge branch 'main' of https://gitee.com/wg123/video-gen
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
"""6idufv2q1c_add_credits_ratio_增加上传视频积分规则
|
||||
|
||||
Revision ID: a1b2c3d4e5f7
|
||||
Revises: 6idufv2q1c
|
||||
Create Date: 2026-07-01 00:00:00.000000
|
||||
|
||||
该文件包含 2026-07-01 的数据库迁移内容:
|
||||
1. 积分规则表增加传入视频计费字段(input_video_ratio, input_video_base_credits, input_video_per_second_credits)
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
revision: str = '6idufv2q1c'
|
||||
down_revision: Union[str, None] = 'a1b2c3d4e5f7'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ========================================
|
||||
# 2026-07-01 - 积分规则表增加传入视频计费字段
|
||||
# ========================================
|
||||
op.add_column('credit_ratios', sa.Column('input_video_ratio', sa.Float(), server_default='1.0', nullable=False))
|
||||
op.add_column('credit_ratios', sa.Column('input_video_base_credits', sa.Float(), server_default='0.0', nullable=False))
|
||||
op.add_column('credit_ratios', sa.Column('input_video_per_second_credits', sa.Float(), server_default='0.5', nullable=False))
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ========================================
|
||||
# 2026-07-01 - 积分规则表增加传入视频计费字段(回滚)
|
||||
# ========================================
|
||||
op.drop_column('credit_ratios', 'input_video_per_second_credits')
|
||||
op.drop_column('credit_ratios', 'input_video_base_credits')
|
||||
op.drop_column('credit_ratios', 'input_video_ratio')
|
||||
@@ -0,0 +1,25 @@
|
||||
"""add max image count to image engines
|
||||
|
||||
Revision ID: a1b2c3d4e5f6
|
||||
Revises: f7a3b2c1d4e5
|
||||
Create Date: 2026-07-01 00:00:00.000000
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
revision: str = 'a1b2c3d4e5f7'
|
||||
down_revision: Union[str, None] = 'f7a3b2c1d4e5'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.add_column('image_engines', sa.Column('max_image_count', sa.Integer(), server_default='0', nullable=False))
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_column('image_engines', 'max_image_count')
|
||||
Reference in New Issue
Block a user