Consolidate bundled plugin schema into the core migration chain
The core chain already owns and reproduces the full bundled schema (deploys run `flask db upgrade` only). The per-plugin Alembic baselines duplicated those tables, so `flask plugin upgrade-all` would conflict - a footgun. Remove the 6 bundled plugin migration dirs; the per-plugin Alembic helpers (alembic_template, PluginMigrationRunner) remain for external/filesystem plugins. upgrade-all now cleanly no-ops for bundled plugins. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
[alembic]
|
||||
script_location = .
|
||||
prepend_sys_path = .
|
||||
file_template = %%(rev)s_%%(slug)s
|
||||
|
||||
[logging]
|
||||
keys = root
|
||||
|
||||
[loggers]
|
||||
keys = root
|
||||
|
||||
[handlers]
|
||||
keys = console
|
||||
|
||||
[formatters]
|
||||
keys = generic
|
||||
|
||||
[logger_root]
|
||||
level = INFO
|
||||
handlers = console
|
||||
qualname =
|
||||
|
||||
[handler_console]
|
||||
class = StreamHandler
|
||||
args = (sys.stderr,)
|
||||
level = INFO
|
||||
formatter = generic
|
||||
|
||||
[formatter_generic]
|
||||
format = %%(levelname)-5.5s [%%(name)s] %%(message)s
|
||||
@@ -1,12 +0,0 @@
|
||||
"""Alembic env.py for the notifications plugin.
|
||||
|
||||
Thin shim that sets PLUGIN_NAME then delegates to the shared template at
|
||||
shopdb.plugins.alembic_template, which filters MetaData to only this
|
||||
plugin's tables and runs Alembic against the Flask app's engine.
|
||||
"""
|
||||
import os
|
||||
os.environ['PLUGIN_NAME'] = 'notifications'
|
||||
|
||||
from shopdb.plugins.alembic_template import run_migrations
|
||||
|
||||
run_migrations()
|
||||
@@ -1,23 +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 = ${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"}
|
||||
@@ -1,27 +0,0 @@
|
||||
"""notifications plugin: baseline schema
|
||||
|
||||
Creates every table owned by the notifications plugin per
|
||||
shopdb.plugins.alembic_template.PLUGIN_TABLE_OWNERS. The table definitions
|
||||
are derived from the SQLAlchemy models at migration runtime so this stays
|
||||
in lockstep with the model layer without duplication.
|
||||
|
||||
Revision ID: 0001_baseline_notifications
|
||||
Revises:
|
||||
Create Date: 2026-05-30
|
||||
|
||||
"""
|
||||
from shopdb.plugins.alembic_template import create_plugin_tables, drop_plugin_tables
|
||||
|
||||
|
||||
revision = '0001_baseline_notifications'
|
||||
down_revision = None
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
create_plugin_tables('notifications')
|
||||
|
||||
|
||||
def downgrade():
|
||||
drop_plugin_tables('notifications')
|
||||
Reference in New Issue
Block a user