omnichannel-deploy/database/migrations/004_whatsapp.sql

9 lines
318 B
MySQL
Raw Permalink Normal View History

CREATE TABLE IF NOT EXISTS whatsapp_chat_atribuicoes (
id SERIAL PRIMARY KEY,
chat_id VARCHAR(255) NOT NULL,
user_id SERIAL REFERENCES usuarios(id) ON DELETE CASCADE,
area_id SERIAL REFERENCES areas(id) ON DELETE SET NULL,
assigned_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
UNIQUE(chat_id)
);