Files
mamad-app/scripts/add-field-column.sql
2025-06-22 00:01:22 +03:00

12 lines
398 B
SQL

USE emergency_tracker;
-- Add field column if it doesn't exist
ALTER TABLE users
ADD COLUMN IF NOT EXISTS field ENUM('הפעלה', 'תוכנה', 'סייבר', 'טכני', 'מטה') DEFAULT NULL AFTER team;
-- Update existing users with default field if they don't have one
UPDATE users SET field = 'מטה' WHERE field IS NULL AND is_admin = TRUE;
-- Show the updated structure
DESCRIBE users;