mikebridge opened a new pull request, #44317:
URL: https://github.com/apache/superset/pull/44317
### SUMMARY
**`superset db upgrade` currently fails on master.** Two migrations landed
as siblings rather than in a chain, so the revision graph has two heads:
| revision | migration | from |
|---|---|---|
| `88a01c781622` | `index_ab_user_lower_username` | #43939 |
| `c7f53d184ea2` | `coordinate_purge_audit_pruning` | #43490 |
Both are childless — nothing declares either as its `down_revision` — so
alembic cannot resolve `head`:
```
ERROR [flask_migrate] Error: Multiple head revisions are present for given
argument 'head';
please specify a specific target revision, '<branchname>@head' to narrow to
a specific head,
or 'heads' for all heads
```
This blocks anyone running migrations on master, including a fresh install
and CI jobs that upgrade a database.
Neither migration depends on the other (one adds a functional index on
`ab_user`, the other coordinates purge-audit pruning), so this is an **empty
merge**: `upgrade()` and `downgrade()` are both `pass`, and the revision exists
only to rejoin the graph. One file, no schema change.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Verified against a **fresh, empty PostgreSQL database**, both directions:
```
without this revision (master today):
ERROR [flask_migrate] Error: Multiple head revisions are present ...
superset.app: The script directory has multiple heads (due to branching).
with this revision:
superset db upgrade -> exit 0
select version_num from alembic_version -> e2f0a912492a (single head)
```
### TESTING INSTRUCTIONS
```
superset db upgrade # from an empty database: completes, single head
```
Or inspect the graph directly — `alembic heads` should report exactly one
revision. Note that a naive regex over the migration files gives the wrong
answer here: several existing merge migrations declare `down_revision` as a
multi-line tuple, so a parser that only handles the single-string form reports
dozens of spurious heads. An AST walk over all 388 revisions returns exactly
one with this change, and exactly the two above without it.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [x] Includes DB Migration (follow approval process in
[SIP-59](https://github.com/apache/superset/issues/13351))
- [x] Migration is atomic, supports rollback & is backwards-compatible
- [x] Confirm DB migration upgrade and downgrade tested
- [x] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
Migration notes: the revision is empty in both directions, so upgrade and
downgrade are instantaneous, require no locks, and need no downtime. No
`UPDATING.md` entry — there is no behavioural change to describe.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01267VBWbvWTNZUg9GvXKgkC
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]