CREATE TABLE IF NOT EXISTS messages (
    id SERIAL PRIMARY KEY,
    timestamp TIMESTAMP,
    channel_id INTEGER NOT NULL,
    user_id INTEGER NOT NULL,
    message_content TEXT NOT NULL,
    CONSTRAINT fk_channel_id
        FOREIGN KEY(channel_id) 
        REFERENCES channels(id)
        ON DELETE CASCADE
);