Update: 2026-05-08 05:09:43
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
-- Gamification Tables for Musadaq
|
||||
-- Run this migration on your production database
|
||||
|
||||
-- Points tracking
|
||||
CREATE TABLE IF NOT EXISTS user_points (
|
||||
@@ -26,6 +25,7 @@ CREATE TABLE IF NOT EXISTS user_badges (
|
||||
INDEX idx_user_badges_tenant (tenant_id)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- WhatsApp link code column (add to users table)
|
||||
ALTER TABLE users ADD COLUMN IF NOT EXISTS whatsapp_link_code VARCHAR(10) DEFAULT NULL;
|
||||
ALTER TABLE users ADD COLUMN IF NOT EXISTS whatsapp_linked TINYINT(1) DEFAULT 0;
|
||||
-- WhatsApp columns on users table
|
||||
-- Run these one at a time. If column already exists, it will error — just skip it.
|
||||
ALTER TABLE users ADD COLUMN whatsapp_link_code VARCHAR(10) DEFAULT NULL;
|
||||
ALTER TABLE users ADD COLUMN whatsapp_linked TINYINT(1) DEFAULT 0;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
-- SMS Bank Integration Tables
|
||||
-- Run this migration on your production database
|
||||
|
||||
CREATE TABLE IF NOT EXISTS raw_sms_log (
|
||||
id VARCHAR(36) PRIMARY KEY,
|
||||
@@ -16,6 +15,7 @@ CREATE TABLE IF NOT EXISTS raw_sms_log (
|
||||
INDEX idx_sms_date (received_at)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- Add sms_log_id to payment_requests if not exists
|
||||
ALTER TABLE payment_requests ADD COLUMN IF NOT EXISTS sms_log_id VARCHAR(36) DEFAULT NULL;
|
||||
ALTER TABLE payment_requests ADD COLUMN IF NOT EXISTS confirmed_at DATETIME DEFAULT NULL;
|
||||
-- Add columns to payment_requests
|
||||
-- Run these one at a time. If column already exists, just skip the error.
|
||||
ALTER TABLE payment_requests ADD COLUMN sms_log_id VARCHAR(36) DEFAULT NULL;
|
||||
ALTER TABLE payment_requests ADD COLUMN confirmed_at DATETIME DEFAULT NULL;
|
||||
|
||||
Reference in New Issue
Block a user