-- a table to manage invitations from one user to another
CREATE TABLE invited_users (
    id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(),
    sender_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE,
    autofriend BOOLEAN NOT NULL,
    email VARCHAR(256) NOT NULL,
    invitation_code VARCHAR(256) UNIQUE NOT NULL,
    accepted BOOLEAN DEFAULT FALSE,
    note text,
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP 
);
