38808-vm/db/migrations/011_add_referral_to_comments.sql
2026-02-28 02:29:08 +00:00

4 lines
248 B
SQL

-- Migration: Add referred_user_id to comments
ALTER TABLE comments ADD COLUMN referred_user_id INT DEFAULT NULL;
ALTER TABLE comments ADD CONSTRAINT fk_comments_referred_user FOREIGN KEY (referred_user_id) REFERENCES users(id) ON DELETE SET NULL;