Prompt #134
Back to promptsGlug Plugin DB Migration
- Variables
- plugin_name, table_name, extra_columns
- Tags
- stack-aware,glug,plugin,db-migration,sqlite
- Source
- research-2026-05-01-stack-aware
- Use count
- 0
- Created
- 2026-05-01T18:30:48.776731+00:00
- Updated
- 2026-05-01T18:30:48.776731+00:00
Content
Add a database migration to a Glug plugin at /nvmetank1/projects/glug/plugins/{plugin_name}/.
Requirements:
- Add a "db_migrations" key to manifest.toml: {"v1": "CREATE TABLE plugin_{plugin_name}_{table_name}(...)"}
- The table must include id, created_at, and {extra_columns} columns
- Migration runs automatically when the plugin is enabled
- Provide a matching v2 migration if {table_name} needs a follow-up index
Show:
1. Updated manifest.toml db_migrations block
2. Rollback strategy (DROP TABLE IF EXISTS) for disable flow
3. How to verify the migration ran: `SELECT name FROM sqlite_master WHERE type='table'`
4. Any __init__.py changes needed for migration hook registration