mirror of
https://gitea.tendokyu.moe/Hay1tsme/artemis.git
synced 2026-02-12 10:47:28 +08:00
add ota update channels
This commit is contained in:
42
core/data/alembic/versions/7070a6fa8cdc_update_channels.py
Normal file
42
core/data/alembic/versions/7070a6fa8cdc_update_channels.py
Normal file
@@ -0,0 +1,42 @@
|
||||
"""update_channels
|
||||
|
||||
Revision ID: 7070a6fa8cdc
|
||||
Revises: f6007bbf057d
|
||||
Create Date: 2025-09-27 16:09:55.853051
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '7070a6fa8cdc'
|
||||
down_revision = 'f6007bbf057d'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('machine_update',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('game', sa.CHAR(length=4), nullable=False),
|
||||
sa.Column('version', sa.VARCHAR(length=15), nullable=False),
|
||||
sa.Column('channel', sa.VARCHAR(length=260), nullable=False),
|
||||
sa.Column('app_ini', sa.VARCHAR(length=260), nullable=True),
|
||||
sa.Column('opt_ini', sa.VARCHAR(length=260), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('game', 'version', 'channel', name='machine_update_uk'),
|
||||
mysql_charset='utf8mb4'
|
||||
)
|
||||
op.add_column('machine', sa.Column('ota_channel', sa.VARCHAR(length=260), nullable=True))
|
||||
op.drop_column('machine', 'ota_enable')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('machine', sa.Column('ota_enable', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True))
|
||||
op.drop_column('machine', 'ota_channel')
|
||||
op.drop_table('machine_update')
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user