修改数据库分支
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
"""增加生成图片的比例像素
|
||||
|
||||
Revision ID: 5d2db654417b
|
||||
Revises: d54d06438b25
|
||||
Create Date: 2026-05-19 17:51:16.099136
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '5d2db654417b'
|
||||
down_revision: Union[str, None] = 'd54d06438b25'
|
||||
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('generation_records', sa.Column('image_proportion', sa.String(length=8), nullable=True))
|
||||
op.add_column('generation_records', sa.Column('image_px', sa.String(length=10), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('generation_records', 'image_px')
|
||||
op.drop_column('generation_records', 'image_proportion')
|
||||
# ### end Alembic commands ###
|
||||
@@ -0,0 +1,25 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 6cf2bcc8915f
|
||||
Revises: 6846d43389b6, d63d9ba0a468
|
||||
Create Date: 2026-05-28 13:37:33.635604
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '6cf2bcc8915f'
|
||||
down_revision: Union[str, None] = ('6846d43389b6', 'd63d9ba0a468')
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
pass
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
pass
|
||||
@@ -0,0 +1,29 @@
|
||||
"""数据库修改
|
||||
|
||||
Revision ID: 8a00badae463
|
||||
Revises: e5d7083ea845
|
||||
Create Date: 2026-06-01 11:36:09.950165
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '8a00badae463'
|
||||
down_revision: Union[str, None] = 'e5d7083ea845'
|
||||
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! ###
|
||||
pass
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
pass
|
||||
# ### end Alembic commands ###
|
||||
@@ -0,0 +1,39 @@
|
||||
"""your message
|
||||
|
||||
Revision ID: aa17f8a032c9
|
||||
Revises: 8623aa4bf3a1
|
||||
Create Date: 2026-06-01 11:31:16.648791
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'aa17f8a032c9'
|
||||
down_revision: Union[str, None] = '8623aa4bf3a1'
|
||||
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('chat_generation_tasks', sa.Column('deleted_at', sa.DateTime(timezone=True), nullable=True))
|
||||
op.create_index(op.f('ix_chat_generation_tasks_deleted_at'), 'chat_generation_tasks', ['deleted_at'], unique=False)
|
||||
op.add_column('generation_records', sa.Column('deleted_at', sa.DateTime(timezone=True), nullable=True))
|
||||
op.create_index(op.f('ix_generation_records_deleted_at'), 'generation_records', ['deleted_at'], unique=False)
|
||||
op.add_column('projects', sa.Column('deleted_at', sa.DateTime(timezone=True), nullable=True))
|
||||
op.create_index(op.f('ix_projects_deleted_at'), 'projects', ['deleted_at'], unique=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(op.f('ix_projects_deleted_at'), table_name='projects')
|
||||
op.drop_column('projects', 'deleted_at')
|
||||
op.drop_index(op.f('ix_generation_records_deleted_at'), table_name='generation_records')
|
||||
op.drop_column('generation_records', 'deleted_at')
|
||||
op.drop_index(op.f('ix_chat_generation_tasks_deleted_at'), table_name='chat_generation_tasks')
|
||||
op.drop_column('chat_generation_tasks', 'deleted_at')
|
||||
# ### end Alembic commands ###
|
||||
@@ -0,0 +1,43 @@
|
||||
"""修改积分规则为float
|
||||
|
||||
Revision ID: aa89e695701d
|
||||
Revises: dc1fbd112814
|
||||
Create Date: 2026-05-22 09:48:36.733150
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'aa89e695701d'
|
||||
down_revision: Union[str, None] = 'dc1fbd112814'
|
||||
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.alter_column('generation_records', 'credits_cost',
|
||||
existing_type=sa.INTEGER(),
|
||||
type_=sa.Float(),
|
||||
existing_nullable=False)
|
||||
op.alter_column('generation_records', 'text_credits_cost',
|
||||
existing_type=sa.INTEGER(),
|
||||
type_=sa.Float(),
|
||||
existing_nullable=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('generation_records', 'text_credits_cost',
|
||||
existing_type=sa.Float(),
|
||||
type_=sa.INTEGER(),
|
||||
existing_nullable=False)
|
||||
op.alter_column('generation_records', 'credits_cost',
|
||||
existing_type=sa.Float(),
|
||||
type_=sa.INTEGER(),
|
||||
existing_nullable=False)
|
||||
# ### end Alembic commands ###
|
||||
@@ -0,0 +1,39 @@
|
||||
"""数据库修改
|
||||
|
||||
Revision ID: baf54bec4cb5
|
||||
Revises: 6cf2bcc8915f
|
||||
Create Date: 2026-05-28 13:40:31.609405
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'baf54bec4cb5'
|
||||
down_revision: Union[str, None] = '6cf2bcc8915f'
|
||||
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_index(op.f('ix_credit_ratios_gen_type'), 'credit_ratios', ['gen_type'], unique=False)
|
||||
op.create_index('ix_credit_ratios_gen_type_engine_resolution', 'credit_ratios', ['gen_type', 'model_config_id', 'resolution'], unique=False)
|
||||
op.create_index('ix_credit_ratios_gen_type_resolution', 'credit_ratios', ['gen_type', 'resolution'], unique=False)
|
||||
op.create_index(op.f('ix_credit_ratios_model_config_id'), 'credit_ratios', ['model_config_id'], unique=False)
|
||||
op.create_index(op.f('ix_credit_ratios_resolution'), 'credit_ratios', ['resolution'], unique=False)
|
||||
op.drop_constraint(op.f('credit_ratios_model_config_id_fkey'), 'credit_ratios', type_='foreignkey')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_foreign_key(op.f('credit_ratios_model_config_id_fkey'), 'credit_ratios', 'model_configs', ['model_config_id'], ['id'])
|
||||
op.drop_index(op.f('ix_credit_ratios_resolution'), table_name='credit_ratios')
|
||||
op.drop_index(op.f('ix_credit_ratios_model_config_id'), table_name='credit_ratios')
|
||||
op.drop_index('ix_credit_ratios_gen_type_resolution', table_name='credit_ratios')
|
||||
op.drop_index('ix_credit_ratios_gen_type_engine_resolution', table_name='credit_ratios')
|
||||
op.drop_index(op.f('ix_credit_ratios_gen_type'), table_name='credit_ratios')
|
||||
# ### end Alembic commands ###
|
||||
@@ -0,0 +1,91 @@
|
||||
"""批量修改积分为float
|
||||
|
||||
Revision ID: d63d9ba0a468
|
||||
Revises: aa89e695701d
|
||||
Create Date: 2026-05-22 10:19:44.860961
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'd63d9ba0a468'
|
||||
down_revision: Union[str, None] = 'aa89e695701d'
|
||||
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.alter_column('credit_ratios', 'base_credits',
|
||||
existing_type=sa.INTEGER(),
|
||||
type_=sa.Float(),
|
||||
existing_nullable=False)
|
||||
op.alter_column('credit_ratios', 'per_second_credits',
|
||||
existing_type=sa.INTEGER(),
|
||||
type_=sa.Float(),
|
||||
existing_nullable=False)
|
||||
op.alter_column('credit_records', 'amount',
|
||||
existing_type=sa.INTEGER(),
|
||||
type_=sa.Float(),
|
||||
existing_nullable=False)
|
||||
op.alter_column('credit_records', 'balance_after',
|
||||
existing_type=sa.INTEGER(),
|
||||
type_=sa.Float(),
|
||||
existing_nullable=False)
|
||||
op.alter_column('payment_orders', 'credits',
|
||||
existing_type=sa.INTEGER(),
|
||||
type_=sa.Float(),
|
||||
existing_nullable=False)
|
||||
op.alter_column('recharge_packages', 'credits',
|
||||
existing_type=sa.INTEGER(),
|
||||
type_=sa.Float(),
|
||||
existing_nullable=False)
|
||||
op.alter_column('recharge_packages', 'bonus_credits',
|
||||
existing_type=sa.INTEGER(),
|
||||
type_=sa.Float(),
|
||||
existing_nullable=False)
|
||||
op.alter_column('users', 'credits',
|
||||
existing_type=sa.INTEGER(),
|
||||
type_=sa.Float(),
|
||||
existing_nullable=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('users', 'credits',
|
||||
existing_type=sa.Float(),
|
||||
type_=sa.INTEGER(),
|
||||
existing_nullable=False)
|
||||
op.alter_column('recharge_packages', 'bonus_credits',
|
||||
existing_type=sa.Float(),
|
||||
type_=sa.INTEGER(),
|
||||
existing_nullable=False)
|
||||
op.alter_column('recharge_packages', 'credits',
|
||||
existing_type=sa.Float(),
|
||||
type_=sa.INTEGER(),
|
||||
existing_nullable=False)
|
||||
op.alter_column('payment_orders', 'credits',
|
||||
existing_type=sa.Float(),
|
||||
type_=sa.INTEGER(),
|
||||
existing_nullable=False)
|
||||
op.alter_column('credit_records', 'balance_after',
|
||||
existing_type=sa.Float(),
|
||||
type_=sa.INTEGER(),
|
||||
existing_nullable=False)
|
||||
op.alter_column('credit_records', 'amount',
|
||||
existing_type=sa.Float(),
|
||||
type_=sa.INTEGER(),
|
||||
existing_nullable=False)
|
||||
op.alter_column('credit_ratios', 'per_second_credits',
|
||||
existing_type=sa.Float(),
|
||||
type_=sa.INTEGER(),
|
||||
existing_nullable=False)
|
||||
op.alter_column('credit_ratios', 'base_credits',
|
||||
existing_type=sa.Float(),
|
||||
type_=sa.INTEGER(),
|
||||
existing_nullable=False)
|
||||
# ### end Alembic commands ###
|
||||
@@ -0,0 +1,31 @@
|
||||
"""删除生成表的输入输出
|
||||
|
||||
Revision ID: dc1fbd112814
|
||||
Revises: 5d2db654417b
|
||||
Create Date: 2026-05-21 09:09:01.544128
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'dc1fbd112814'
|
||||
down_revision: Union[str, None] = '5d2db654417b'
|
||||
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.drop_column('generation_records', 'request_data')
|
||||
op.drop_column('generation_records', 'response_data')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('generation_records', sa.Column('response_data', sa.TEXT(), autoincrement=False, nullable=True))
|
||||
op.add_column('generation_records', sa.Column('request_data', sa.TEXT(), autoincrement=False, nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
@@ -0,0 +1,25 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: e5d7083ea845
|
||||
Revises: aa17f8a032c9, baf54bec4cb5
|
||||
Create Date: 2026-06-01 11:35:37.690659
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'e5d7083ea845'
|
||||
down_revision: Union[str, None] = ('aa17f8a032c9', 'baf54bec4cb5')
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
pass
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
pass
|
||||
Reference in New Issue
Block a user