All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sql.globals.V3__create_user_tenant_right_table.sql Maven / Gradle / Ivy

CREATE TYPE RIGHT_LEVEL AS ENUM ('READ', 'WRITE', 'ADMIN');

CREATE TABLE users_tenants_rights (
    username TEXT NOT NULL REFERENCES users(username) ON DELETE CASCADE ON UPDATE CASCADE,
    tenant TEXT NOT NULL REFERENCES tenants(name) ON DELETE CASCADE ON UPDATE CASCADE,
    level RIGHT_LEVEL NOT NULL DEFAULT 'READ',
    PRIMARY KEY (username, tenant)
);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy