From ff6d1bf3c9bc2f5b0f8edebfc5cfc221dd43369f Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Tue, 2 Jun 2026 19:03:43 -0500 Subject: [PATCH] fix(licenses): add explicit xorm column names for all UpdateStreamConfig fields xorm auto-maps CamelCase to snake_case by splitting on each uppercase letter. MaintainerURL became maintainer_u_r_l instead of maintainer_url, causing DB reads to return empty values. Added explicit column name tags to all multi-word fields: SupportURL, KeyPrefix, ExtensionName, DisplayName, ExtensionType, MaintainerURL, InfoURL, TargetVersion, PHPMinimum, LicensingEnabled, RequireKey, FeedVisibility, DownloadGating, StreamMode, CustomStreams. Co-Authored-By: Claude Opus 4.6 (1M context) --- models/licenses/update_stream_config.go | 30 ++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/models/licenses/update_stream_config.go b/models/licenses/update_stream_config.go index 9f465a21de..d3a562cac1 100644 --- a/models/licenses/update_stream_config.go +++ b/models/licenses/update_stream_config.go @@ -23,27 +23,27 @@ type UpdateStreamConfig struct { ID int64 `xorm:"pk autoincr"` OwnerID int64 `xorm:"INDEX NOT NULL"` // org or user RepoID int64 `xorm:"INDEX NOT NULL DEFAULT 0"` // 0 = org-level default - StreamMode string `xorm:"NOT NULL DEFAULT 'joomla'"` // joomla, custom + StreamMode string `xorm:"NOT NULL DEFAULT 'joomla' 'stream_mode'"` // joomla, custom Platform string `xorm:"NOT NULL DEFAULT 'joomla'"` // joomla, dolibarr, both, wordpress, prestashop, drupal - LicensingEnabled bool `xorm:"NOT NULL DEFAULT false"` // master toggle for licensing system - RequireKey bool `xorm:"NOT NULL DEFAULT false"` // require license key for update feed - FeedVisibility string `xorm:"VARCHAR(20) NOT NULL DEFAULT 'public'"` // public, no-download, hidden - DownloadGating string `xorm:"VARCHAR(20) NOT NULL DEFAULT 'none'"` // none, all, prerelease - SupportURL string `xorm:"TEXT"` // wiki or external support page URL - KeyPrefix string `xorm:"VARCHAR(20)"` // org-specific license key prefix (e.g. "ACME") + LicensingEnabled bool `xorm:"NOT NULL DEFAULT false 'licensing_enabled'"` // master toggle + RequireKey bool `xorm:"NOT NULL DEFAULT false 'require_key'"` // require license key for update feed + FeedVisibility string `xorm:"VARCHAR(20) NOT NULL DEFAULT 'public' 'feed_visibility'"` // public, no-download, hidden + DownloadGating string `xorm:"VARCHAR(20) NOT NULL DEFAULT 'none' 'download_gating'"` // none, all, prerelease + SupportURL string `xorm:"TEXT 'support_url'"` // wiki or external support page URL + KeyPrefix string `xorm:"VARCHAR(20) 'key_prefix'"` // org-specific license key prefix (e.g. "ACME") // Extension metadata — used in update feed generation. - ExtensionName string `xorm:"TEXT"` // element identifier (e.g. pkg_mokowaas, com_mokowaas) - DisplayName string `xorm:"TEXT"` // human-readable name (e.g. "Package - MokoWaaS") + ExtensionName string `xorm:"TEXT 'extension_name'"` // element identifier (e.g. pkg_mokowaas, com_mokowaas) + DisplayName string `xorm:"TEXT 'display_name'"` // human-readable name (e.g. "Package - MokoWaaS") Description string `xorm:"TEXT"` // short description for update feeds - ExtensionType string `xorm:"VARCHAR(50)"` // component, module, plugin, package, template, library + ExtensionType string `xorm:"VARCHAR(50) 'extension_type'"` // component, module, plugin, package, template, library Maintainer string `xorm:"TEXT"` // maintainer/author name - MaintainerURL string `xorm:"TEXT"` // maintainer website - InfoURL string `xorm:"TEXT"` // extension info/product page URL - TargetVersion string `xorm:"TEXT"` // target platform version regex (e.g. "(5|6)\..*") - PHPMinimum string `xorm:"VARCHAR(20)"` // minimum PHP version (e.g. "8.1") + MaintainerURL string `xorm:"TEXT 'maintainer_url'"` // maintainer website + InfoURL string `xorm:"TEXT 'info_url'"` // extension info/product page URL + TargetVersion string `xorm:"TEXT 'target_version'"` // target platform version regex (e.g. "(5|6)\..*") + PHPMinimum string `xorm:"VARCHAR(20) 'php_minimum'"` // minimum PHP version (e.g. "8.1") // CustomStreams is a JSON array of stream definitions. // Each entry: {"name":"lts","suffix":"-lts","description":"Long-term support"} - CustomStreams string `xorm:"TEXT"` + CustomStreams string `xorm:"TEXT 'custom_streams'"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX CREATED"` UpdatedUnix timeutil.TimeStamp `xorm:"UPDATED"` }