chore: bump to v1.3.0-aio.1 and make m006 idempotent
Sets the rebase foundation: version metadata, point repo at the aio fork, and a duplicate-column-tolerant m006 so AIO installs that already ran our pre-rebase m007_add_extra_fields don't fail when LNbits replays upstream's m006 under its new name. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4afc78d44d
commit
708d15629c
2 changed files with 28 additions and 9 deletions
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"id": "events",
|
"id": "events",
|
||||||
"version": "1.3.0",
|
"version": "1.3.0-aio.1",
|
||||||
"name": "Events",
|
"name": "Events",
|
||||||
"repo": "https://github.com/lnbits/events",
|
"repo": "https://git.atitlan.io/aiolabs/events",
|
||||||
"short_description": "Sell and register event tickets",
|
"short_description": "Sell and register event tickets",
|
||||||
"description": "",
|
"description": "",
|
||||||
"tile": "/events/static/image/events.png",
|
"tile": "/events/static/image/events.png",
|
||||||
|
|
@ -32,6 +32,11 @@
|
||||||
"name": "motorina0",
|
"name": "motorina0",
|
||||||
"uri": "https://github.com/motorina0",
|
"uri": "https://github.com/motorina0",
|
||||||
"role": "Developer"
|
"role": "Developer"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "padreug",
|
||||||
|
"uri": "https://git.atitlan.io/padreug",
|
||||||
|
"role": "Developer (aio fork: approval workflow + NIP-52 Nostr sync)"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"images": [
|
"images": [
|
||||||
|
|
|
||||||
|
|
@ -162,16 +162,30 @@ async def m005_add_image_banner(db):
|
||||||
await db.execute("ALTER TABLE events.events ADD COLUMN banner TEXT;")
|
await db.execute("ALTER TABLE events.events ADD COLUMN banner TEXT;")
|
||||||
|
|
||||||
|
|
||||||
|
async def _alter_add_column_safe(db, sql: str) -> None:
|
||||||
|
"""ALTER TABLE ADD COLUMN that swallows duplicate-column errors.
|
||||||
|
|
||||||
|
Earlier aiolabs/events forks added some of these columns under different
|
||||||
|
migration names (e.g. our former m007). Skipping the error keeps the
|
||||||
|
migration log monotonic for both fresh installs and pre-rebase upgrades.
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
await db.execute(sql)
|
||||||
|
except Exception as exc:
|
||||||
|
msg = str(exc).lower()
|
||||||
|
if "duplicate column" in msg or "already exists" in msg:
|
||||||
|
return
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
async def m006_add_extra_fields(db):
|
async def m006_add_extra_fields(db):
|
||||||
"""
|
"""
|
||||||
Add a canceled and 'extra' column to events and ticket tables
|
Add a canceled and 'extra' column to events and ticket tables
|
||||||
to support promo codes and ticket metadata.
|
to support promo codes and ticket metadata.
|
||||||
"""
|
"""
|
||||||
# Add canceled and 'extra' columns to events table
|
await _alter_add_column_safe(
|
||||||
await db.execute(
|
db,
|
||||||
"ALTER TABLE events.events ADD COLUMN canceled BOOLEAN NOT NULL DEFAULT FALSE;"
|
"ALTER TABLE events.events ADD COLUMN canceled BOOLEAN NOT NULL DEFAULT FALSE",
|
||||||
)
|
)
|
||||||
await db.execute("ALTER TABLE events.events ADD COLUMN extra TEXT;")
|
await _alter_add_column_safe(db, "ALTER TABLE events.events ADD COLUMN extra TEXT")
|
||||||
|
await _alter_add_column_safe(db, "ALTER TABLE events.ticket ADD COLUMN extra TEXT")
|
||||||
# Add 'extra' column to ticket table
|
|
||||||
await db.execute("ALTER TABLE events.ticket ADD COLUMN extra TEXT;")
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue