fix(licenses): add database migration for new license_key columns (KeyRaw, PaymentRef, LastHeartbeatUnix) #386

Closed
opened 2026-06-01 09:19:03 +00:00 by jmiller · 2 comments
Owner

Summary

The license_key model has three columns that were added to the Go struct but have no corresponding database migration:

  • KeyRaw (TEXT) — plaintext key for admin viewing
  • PaymentRef (UNIQUE) — idempotency key for payment webhooks
  • LastHeartbeatUnix (DEFAULT 0) — last successful validation timestamp

The v337 migration only adds KeyPlain which was renamed to KeyRaw in the model. Need a new migration to sync.

Also need migration for update_stream_config new columns:

  • LicensingEnabled (DEFAULT false)
  • ExtensionName, DisplayName, Description, ExtensionType
  • Maintainer, MaintainerURL, InfoURL, TargetVersion, PHPMinimum

Test Plan

  • Fresh install creates tables with all columns
  • Existing install runs migration without errors
  • Verify KeyRaw column exists and stores plaintext
  • Verify PaymentRef UNIQUE constraint works
  • Verify LastHeartbeatUnix updates on validation
  • Verify all UpdateStreamConfig metadata columns exist

🤖 Generated with Claude Code

## Summary The `license_key` model has three columns that were added to the Go struct but have no corresponding database migration: - `KeyRaw` (TEXT) — plaintext key for admin viewing - `PaymentRef` (UNIQUE) — idempotency key for payment webhooks - `LastHeartbeatUnix` (DEFAULT 0) — last successful validation timestamp The v337 migration only adds `KeyPlain` which was renamed to `KeyRaw` in the model. Need a new migration to sync. Also need migration for `update_stream_config` new columns: - `LicensingEnabled` (DEFAULT false) - `ExtensionName`, `DisplayName`, `Description`, `ExtensionType` - `Maintainer`, `MaintainerURL`, `InfoURL`, `TargetVersion`, `PHPMinimum` ## Test Plan - [ ] Fresh install creates tables with all columns - [ ] Existing install runs migration without errors - [ ] Verify KeyRaw column exists and stores plaintext - [ ] Verify PaymentRef UNIQUE constraint works - [ ] Verify LastHeartbeatUnix updates on validation - [ ] Verify all UpdateStreamConfig metadata columns exist 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

Testing Plan — Database Migration

Superseded by #389 (migration v340). Same test plan applies.

DB

  • Fresh install creates all license tables with all columns
  • Upgrade from pre-v340 runs migration successfully
  • All new columns have correct defaults (false, 0, empty)
  • UNIQUE constraint on payment_ref enforced
  • No data loss on existing license_key/license_package records

🤖 Generated with Claude Code

## Testing Plan — Database Migration Superseded by #389 (migration v340). Same test plan applies. ### DB - [ ] Fresh install creates all license tables with all columns - [ ] Upgrade from pre-v340 runs migration successfully - [ ] All new columns have correct defaults (false, 0, empty) - [ ] UNIQUE constraint on payment_ref enforced - [ ] No data loss on existing license_key/license_package records 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jmiller added the pending: testing label 2026-06-01 10:13:51 +00:00
Author
Owner

Superseded by #389 (migration v340) which covers all columns.

?? Generated with Claude Code

Superseded by #389 (migration v340) which covers all columns. ?? Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No labels pending: testing
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoGitea#386