update cql files
This commit is contained in:
@@ -1,6 +1,63 @@
|
|||||||
-- Create a keyspace
|
-- Role: role_administrator
|
||||||
CREATE KEYSPACE IF NOT EXISTS device_configuration
|
-- DROP ROLE role_administrator;
|
||||||
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
|
CREATE ROLE role_administrator WITH LOGIN = false AND SUPERUSER = false;
|
||||||
|
|
||||||
-- Use the keyspace
|
|
||||||
USE device_configuration;
|
-- Role: role_service
|
||||||
|
-- DROP ROLE role_service;
|
||||||
|
CREATE ROLE role_service WITH LOGIN = false AND SUPERUSER = false;
|
||||||
|
|
||||||
|
|
||||||
|
-- Role: role_maintainer
|
||||||
|
-- DROP ROLE role_maintainer;
|
||||||
|
CREATE ROLE role_maintainer WITH LOGIN = false AND SUPERUSER = false;
|
||||||
|
|
||||||
|
|
||||||
|
-- Role: role_support
|
||||||
|
-- DROP ROLE role_support;
|
||||||
|
CREATE ROLE role_support WITH LOGIN = false AND SUPERUSER = false;
|
||||||
|
|
||||||
|
|
||||||
|
-- Owner administrator
|
||||||
|
-- DROP ROLE administrator;
|
||||||
|
CREATE ROLE administrator WITH PASSWORD = 'password' AND LOGIN = true;
|
||||||
|
GRANT role_administrator TO administrator;
|
||||||
|
|
||||||
|
|
||||||
|
-- Owner service
|
||||||
|
-- DROP ROLE service;
|
||||||
|
CREATE ROLE service WITH PASSWORD = 'password' AND LOGIN = true;
|
||||||
|
GRANT role_service TO service;
|
||||||
|
|
||||||
|
|
||||||
|
-- Owner maintainer
|
||||||
|
-- DROP ROLE maintainer;
|
||||||
|
CREATE ROLE maintainer WITH PASSWORD = 'password' AND LOGIN = true;
|
||||||
|
GRANT role_maintainer TO maintainer;
|
||||||
|
|
||||||
|
|
||||||
|
-- Owner support
|
||||||
|
-- DROP ROLE support;
|
||||||
|
CREATE ROLE support WITH PASSWORD = 'password' AND LOGIN = true;
|
||||||
|
GRANT role_support TO support;
|
||||||
|
|
||||||
|
|
||||||
|
-- Keyspace
|
||||||
|
-- DROP KEYSPACE device_configuration;
|
||||||
|
CREATE KEYSPACE device_configuration
|
||||||
|
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}
|
||||||
|
AND durable_writes = true;
|
||||||
|
|
||||||
|
|
||||||
|
-- Revoke all permissions from existing roles
|
||||||
|
-- REVOKE ALL PERMISSIONS ON KEYSPACE device_configuration FROM role_administrator;
|
||||||
|
-- REVOKE ALL PERMISSIONS ON KEYSPACE device_configuration FROM role_service;
|
||||||
|
-- REVOKE ALL PERMISSIONS ON KEYSPACE device_configuration FROM role_maintainer;
|
||||||
|
-- REVOKE ALL PERMISSIONS ON KEYSPACE device_configuration FROM role_support;
|
||||||
|
|
||||||
|
|
||||||
|
-- Grant permissions
|
||||||
|
GRANT ALL PERMISSIONS ON KEYSPACE device_configuration TO role_administrator;
|
||||||
|
GRANT SELECT, MODIFY ON KEYSPACE device_configuration TO role_service;
|
||||||
|
GRANT SELECT, MODIFY ON KEYSPACE device_configuration TO role_maintainer;
|
||||||
|
GRANT SELECT ON KEYSPACE device_configuration TO role_support;
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
-- Create a table
|
-- Table: nodes
|
||||||
|
-- DROP TABLE IF EXISTS device_configuration.nodes;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS device_configuration.nodes
|
CREATE TABLE IF NOT EXISTS device_configuration.nodes
|
||||||
(
|
(
|
||||||
id UUID PRIMARY KEY,
|
id UUID PRIMARY KEY,
|
||||||
|
|||||||
Reference in New Issue
Block a user