Files
hi-server/initialize/migrate/database/02151_order_activation_context.up.sql
T
shanshanzhong147 bb67ebcb79
Build docker and publish / build (20.15.1) (push) Failing after 8m27s
chore: rename activation context migration to 02151
Co-authored-by: multica-agent <github@multica.ai>
2026-05-25 02:21:37 -07:00

7 lines
539 B
SQL

-- Add activation_context column to order table for Redis fallback persistence (idempotent)
SET @col_exists = (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'order' AND COLUMN_NAME = 'activation_context');
SET @sql = IF(@col_exists = 0, 'ALTER TABLE `order` ADD COLUMN `activation_context` TEXT DEFAULT NULL COMMENT ''Activation context JSON (guest/redemption info for DB fallback)'' AFTER `app_account_token`', 'SELECT 1');
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;