CREATE TABLE IF NOT EXISTS group_memberships (
    id TEXT,
    created BIGINT NOT NULL,
    owner TEXT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
    group_id TEXT NOT NULL REFERENCES groups(id) ON DELETE CASCADE,
    role TEXT NOT NULL,
    PRIMARY KEY (id, owner)
)
