<?php

return <<<'SQL'
CREATE TABLE tenant_user_roles (
    id CHAR(36) NOT NULL PRIMARY KEY,
    tenant_user_id CHAR(36) NOT NULL,
    role_id CHAR(36) NOT NULL,
    created_at DATETIME NOT NULL,
    UNIQUE (tenant_user_id, role_id),
    FOREIGN KEY (tenant_user_id) REFERENCES tenant_users(id),
    FOREIGN KEY (role_id) REFERENCES roles(id)
);
SQL;
