From 70d76f45e79cd2c781500377664b0b0ba346ab1f Mon Sep 17 00:00:00 2001 From: ske087 Date: Fri, 1 Aug 2025 13:22:37 -0400 Subject: [PATCH] updated --- migrations/README | 1 - migrations/__pycache__/env.cpython-312.pyc | Bin 4512 -> 0 bytes migrations/alembic.ini | 50 -------- migrations/env.py | 113 ------------------ migrations/script.py.mako | 24 ---- ...767_add_position_field_to_content_model.py | 46 ------- ...ion_field_to_content_model.cpython-312.pyc | Bin 2074 -> 0 bytes ...ion_field_to_content_model.cpython-312.pyc | Bin 2653 -> 0 bytes ...472_add_position_field_to_content_model.py | 62 ---------- 9 files changed, 296 deletions(-) delete mode 100644 migrations/README delete mode 100644 migrations/__pycache__/env.cpython-312.pyc delete mode 100644 migrations/alembic.ini delete mode 100644 migrations/env.py delete mode 100644 migrations/script.py.mako delete mode 100644 migrations/versions/54d8ece92767_add_position_field_to_content_model.py delete mode 100644 migrations/versions/__pycache__/54d8ece92767_add_position_field_to_content_model.cpython-312.pyc delete mode 100644 migrations/versions/__pycache__/c2aad6547472_add_position_field_to_content_model.cpython-312.pyc delete mode 100644 migrations/versions/c2aad6547472_add_position_field_to_content_model.py diff --git a/migrations/README b/migrations/README deleted file mode 100644 index 0e04844..0000000 --- a/migrations/README +++ /dev/null @@ -1 +0,0 @@ -Single-database configuration for Flask. diff --git a/migrations/__pycache__/env.cpython-312.pyc b/migrations/__pycache__/env.cpython-312.pyc deleted file mode 100644 index 509c236973bf0d625a5b852ec73fd28308621e14..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4512 zcmbVPU2GHC6~5z{u|2lqaS}qv4`K4-5T_wOPy!oRmOw#5yF}GOtCFg+CY~F6j6HVm zj1z*A%B@x^tFF4BMPjS=AyW6DE4C6()xPurUi*?EL6c5Xsa092eG3T{t337G8IPR= z)2@20Ile#V+*Xqx`}a!lSg z?PF-4&9QlInsfSGj?eq2{S3nXY}DJP_CFo)A?(9}Y^*lt^&Y|*v@r;HP`1e(?WPLv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_<1(P7bb1JQM?U14ps`ELl+kO|ubehj8 zz`K~yQ6z;F*7c+(ldOr{p4bm4j#~_$%@tB|PCqyNUu3@zr|4IKK$Z?S-5-DO&b@b* zrygBe3s0=K99d@W{pil+b+N?~yG^m%5(iCja7`RqmwN7oel>QtVIy|%LHJ&HrSt5w z*xQ>tiX8(IIpfx06iLWQAX5pS9jf^i>81;`UQ2|XvY*iJ4?9}L)+7`iy3K-$-6D{F zDp8+w)JEb|nxZf1r{pLQ&?r5}g=befT#=y(hB&CYSD`I+bw(%*y$g^2M<8Xib&%)J zy^Ny9PAk@L#`>2R%-EO}J8#C$m#?e`Vn1K{>C#He@zubImB5+x6H|ADm8KChIQqP) z^OK?SyMGf7SVE^Mbgl|rn<&V~mj@kSZZm^zn}`!a>#f}zodds~dcnhB(~rbMTLI|3 zjG$S(1i?An6RNVoafoUGq; zKhOe|k5$(cj`PP{-X#6lO=@x;zSO{S?>P=nXcg#wWYGfL7Ij)C?#imv@`Oe=IZTOT zR+f8yQh1pULpCgw*hGrCf83+{M4D%Nh{VR%pg${p(IyPy7 z{J87GuCo6{5HaC9<5sxG4EL;|-gTk4j z=%9%XuCyNgylXY_)*6~vkF>g$Sbocl9J3;$W@NN1Y{ginYb(;kbZ-qxOnehcIIg37 b%3|A1wtbE5{4>}7jO+Y6*Y=F-aKht1#8Jiy diff --git a/migrations/alembic.ini b/migrations/alembic.ini deleted file mode 100644 index ec9d45c..0000000 --- a/migrations/alembic.ini +++ /dev/null @@ -1,50 +0,0 @@ -# A generic, single database configuration. - -[alembic] -# template used to generate migration files -# file_template = %%(rev)s_%%(slug)s - -# set to 'true' to run the environment during -# the 'revision' command, regardless of autogenerate -# revision_environment = false - - -# Logging configuration -[loggers] -keys = root,sqlalchemy,alembic,flask_migrate - -[handlers] -keys = console - -[formatters] -keys = generic - -[logger_root] -level = WARN -handlers = console -qualname = - -[logger_sqlalchemy] -level = WARN -handlers = -qualname = sqlalchemy.engine - -[logger_alembic] -level = INFO -handlers = -qualname = alembic - -[logger_flask_migrate] -level = INFO -handlers = -qualname = flask_migrate - -[handler_console] -class = StreamHandler -args = (sys.stderr,) -level = NOTSET -formatter = generic - -[formatter_generic] -format = %(levelname)-5.5s [%(name)s] %(message)s -datefmt = %H:%M:%S diff --git a/migrations/env.py b/migrations/env.py deleted file mode 100644 index 4c97092..0000000 --- a/migrations/env.py +++ /dev/null @@ -1,113 +0,0 @@ -import logging -from logging.config import fileConfig - -from flask import current_app - -from alembic import context - -# this is the Alembic Config object, which provides -# access to the values within the .ini file in use. -config = context.config - -# Interpret the config file for Python logging. -# This line sets up loggers basically. -fileConfig(config.config_file_name) -logger = logging.getLogger('alembic.env') - - -def get_engine(): - try: - # this works with Flask-SQLAlchemy<3 and Alchemical - return current_app.extensions['migrate'].db.get_engine() - except (TypeError, AttributeError): - # this works with Flask-SQLAlchemy>=3 - return current_app.extensions['migrate'].db.engine - - -def get_engine_url(): - try: - return get_engine().url.render_as_string(hide_password=False).replace( - '%', '%%') - except AttributeError: - return str(get_engine().url).replace('%', '%%') - - -# add your model's MetaData object here -# for 'autogenerate' support -# from myapp import mymodel -# target_metadata = mymodel.Base.metadata -config.set_main_option('sqlalchemy.url', get_engine_url()) -target_db = current_app.extensions['migrate'].db - -# other values from the config, defined by the needs of env.py, -# can be acquired: -# my_important_option = config.get_main_option("my_important_option") -# ... etc. - - -def get_metadata(): - if hasattr(target_db, 'metadatas'): - return target_db.metadatas[None] - return target_db.metadata - - -def run_migrations_offline(): - """Run migrations in 'offline' mode. - - This configures the context with just a URL - and not an Engine, though an Engine is acceptable - here as well. By skipping the Engine creation - we don't even need a DBAPI to be available. - - Calls to context.execute() here emit the given string to the - script output. - - """ - url = config.get_main_option("sqlalchemy.url") - context.configure( - url=url, target_metadata=get_metadata(), literal_binds=True - ) - - with context.begin_transaction(): - context.run_migrations() - - -def run_migrations_online(): - """Run migrations in 'online' mode. - - In this scenario we need to create an Engine - and associate a connection with the context. - - """ - - # this callback is used to prevent an auto-migration from being generated - # when there are no changes to the schema - # reference: http://alembic.zzzcomputing.com/en/latest/cookbook.html - def process_revision_directives(context, revision, directives): - if getattr(config.cmd_opts, 'autogenerate', False): - script = directives[0] - if script.upgrade_ops.is_empty(): - directives[:] = [] - logger.info('No changes in schema detected.') - - conf_args = current_app.extensions['migrate'].configure_args - if conf_args.get("process_revision_directives") is None: - conf_args["process_revision_directives"] = process_revision_directives - - connectable = get_engine() - - with connectable.connect() as connection: - context.configure( - connection=connection, - target_metadata=get_metadata(), - **conf_args - ) - - with context.begin_transaction(): - context.run_migrations() - - -if context.is_offline_mode(): - run_migrations_offline() -else: - run_migrations_online() diff --git a/migrations/script.py.mako b/migrations/script.py.mako deleted file mode 100644 index 2c01563..0000000 --- a/migrations/script.py.mako +++ /dev/null @@ -1,24 +0,0 @@ -"""${message} - -Revision ID: ${up_revision} -Revises: ${down_revision | comma,n} -Create Date: ${create_date} - -""" -from alembic import op -import sqlalchemy as sa -${imports if imports else ""} - -# revision identifiers, used by Alembic. -revision = ${repr(up_revision)} -down_revision = ${repr(down_revision)} -branch_labels = ${repr(branch_labels)} -depends_on = ${repr(depends_on)} - - -def upgrade(): - ${upgrades if upgrades else "pass"} - - -def downgrade(): - ${downgrades if downgrades else "pass"} diff --git a/migrations/versions/54d8ece92767_add_position_field_to_content_model.py b/migrations/versions/54d8ece92767_add_position_field_to_content_model.py deleted file mode 100644 index bdf6e2d..0000000 --- a/migrations/versions/54d8ece92767_add_position_field_to_content_model.py +++ /dev/null @@ -1,46 +0,0 @@ -"""Add position field to Content model - -Revision ID: 54d8ece92767 -Revises: -Create Date: 2025-06-29 15:32:30.794390 - -""" -from alembic import op -import sqlalchemy as sa - - -# revision identifiers, used by Alembic. -revision = '54d8ece92767' -down_revision = None -branch_labels = None -depends_on = None - - -def upgrade(): - # ### commands auto generated by Alembic - please adjust! ### - with op.batch_alter_table('content', schema=None) as batch_op: - batch_op.add_column(sa.Column('position', sa.Integer(), nullable=True)) - batch_op.alter_column('file_name', - existing_type=sa.VARCHAR(length=120), - type_=sa.String(length=255), - existing_nullable=False) - batch_op.alter_column('player_id', - existing_type=sa.INTEGER(), - nullable=False) - - # ### end Alembic commands ### - - -def downgrade(): - # ### commands auto generated by Alembic - please adjust! ### - with op.batch_alter_table('content', schema=None) as batch_op: - batch_op.alter_column('player_id', - existing_type=sa.INTEGER(), - nullable=True) - batch_op.alter_column('file_name', - existing_type=sa.String(length=255), - type_=sa.VARCHAR(length=120), - existing_nullable=False) - batch_op.drop_column('position') - - # ### end Alembic commands ### diff --git a/migrations/versions/__pycache__/54d8ece92767_add_position_field_to_content_model.cpython-312.pyc b/migrations/versions/__pycache__/54d8ece92767_add_position_field_to_content_model.cpython-312.pyc deleted file mode 100644 index f3bff9e5d43b79e1bf7181b054a64188dc4c7ac0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2074 zcmb_dOKclO7@qao-bd^ZLtY|wye$HC1C3LsZXQCB@@OHKAcY9Y7GkyWOp{I5yJmLN z#0aDuIC80k)I@-qW258%0twDNA#sXiDbdm!Tyk>>C{ix)&#s*~sf&cfSo7^X{`u#h zneY4kOFS+kC?93@Wg~*nZ>-ZOp?c$Z6dDf^Mg@d995T65s1V{YDF7>5fH%on0i z1*js9e2xkdjsnURUKKu}lNc*y+c8|jwv@XDF|p#>%Cv2{#B!CAjfpAC^W?taFoW5d zaV2*XkCGx8%Z}U{31)~huE^7r=q^!a0LGQVSTo{ilh5|%nV^k@J+a}V z$+Dw`rF3qI<-NAuaA5PoonuY@UVh%+*=gjxc;hs{9RJt2Ne)%eYv=}YxHVu^9&zxi zpmjcv);P6&&J&6OQFb^l>J*nrN%zDCn-<`WMQhbG^+l6-(p|$Onx&V>(K^J!7MR3Z za+i<(hVGpm-iwoU!*LC3NpmY@;zby0UgB)@+*R4sD}-tW-U-nJtfuU(RGG3T@e+%= zTU^$3(*+aP-&@u(){3^dTC%*5qkGZmpe@V-%a;iCVu5wtMEGEGe)`?Xc`y3DOCcUl zn4Md={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)`qMyP96$svXV6ax-%*Zj)iZ_vEHC-Wq^Yct<= z*9^Z=BRnF|;G@ra-MZtLs}A8x#bds(#Fd)K*oH^(;dfw!r*7A6>z3uYF0p)LFm^K= zrQ&|`(N)v8Du(I!gc^R=RHE0gJf~iDd5D=j_Q~SP(ua#HJo>RuVKcB%rMJ$jF>ztF zBO_PwswBs5k(p94hwU{RBD+Iqu4=DQQ!t<9peY#6azPRrCdS4<9gMCz7`|t~hJ`v9 zU3HkQHF&IE14Ee5N$~d?Jgg0{iGGd`J&dOx#M3*KUB4NhZKILM)Hg~?8F{FrA1LXa z^+)N+ul0NSE^DT*JxYylm$%CIt!C;{>*BlZ7>ZB)isX2vt)Temt6TBIMB(&pz4L5a zQ%^5IG*3lHj|Cic5)kyxQek;a{&p;~JQ@36wICr-0$hKdcBnxHpQ6-50edHD$BQd< z;#lACi+E1He9!+#wW#=HQIP{WCSX{AxP>$YaFd=9)pG#XsbD1?5+IJCuP}66bi6L$ z4FMMfoEPvWKu4@(~ zqnlB#(EeX1o)j50j+?90bV1zV3qc&lRZMEc#mw;Bu82~RX8D5}7!^skBBWHj}N9a{$TFP4$=PS!t>>eOAiQ H%dqTs(UBF~ diff --git a/migrations/versions/c2aad6547472_add_position_field_to_content_model.py b/migrations/versions/c2aad6547472_add_position_field_to_content_model.py deleted file mode 100644 index 907322d..0000000 --- a/migrations/versions/c2aad6547472_add_position_field_to_content_model.py +++ /dev/null @@ -1,62 +0,0 @@ -"""Add position field to Content model - -Revision ID: c2aad6547472 -Revises: 54d8ece92767 -Create Date: 2025-06-29 15:58:57.678396 - -""" -from alembic import op -import sqlalchemy as sa - - -# revision identifiers, used by Alembic. -revision = 'c2aad6547472' -down_revision = '54d8ece92767' -branch_labels = None -depends_on = None - - -def upgrade(): - # ### commands auto generated by Alembic - please adjust! ### - with op.batch_alter_table('player', schema=None) as batch_op: - batch_op.alter_column('username', - existing_type=sa.VARCHAR(length=100), - type_=sa.String(length=255), - existing_nullable=False) - batch_op.alter_column('hostname', - existing_type=sa.VARCHAR(length=100), - type_=sa.String(length=255), - existing_nullable=False) - batch_op.alter_column('password', - existing_type=sa.VARCHAR(length=200), - type_=sa.String(length=255), - existing_nullable=False) - batch_op.alter_column('quickconnect_password', - existing_type=sa.VARCHAR(length=200), - type_=sa.String(length=255), - existing_nullable=True) - - # ### end Alembic commands ### - - -def downgrade(): - # ### commands auto generated by Alembic - please adjust! ### - with op.batch_alter_table('player', schema=None) as batch_op: - batch_op.alter_column('quickconnect_password', - existing_type=sa.String(length=255), - type_=sa.VARCHAR(length=200), - existing_nullable=True) - batch_op.alter_column('password', - existing_type=sa.String(length=255), - type_=sa.VARCHAR(length=200), - existing_nullable=False) - batch_op.alter_column('hostname', - existing_type=sa.String(length=255), - type_=sa.VARCHAR(length=100), - existing_nullable=False) - batch_op.alter_column('username', - existing_type=sa.String(length=255), - type_=sa.VARCHAR(length=100), - existing_nullable=False) - - # ### end Alembic commands ###