frcrawler-scripts/schemas/00_database.clickhouse.sql
Gaël Berthaud-Müller 38679a009a add all files
2024-03-06 14:49:11 +01:00

11 lines
779 B
SQL

CREATE USER IF NOT EXISTS crawler ON CLUSTER ${CH_CLUSTER} IDENTIFIED WITH sha256_hash BY '${CH_PASSWORD_SHA256}' DEFAULT DATABASE ${CH_DATABASE};
GRANT ON CLUSTER ${CH_CLUSTER} CLUSTER ON *.* TO crawler;
GRANT ON CLUSTER ${CH_CLUSTER} SELECT, INSERT ON ${CH_DATABASE}.* TO crawler;
GRANT ON CLUSTER ${CH_CLUSTER} ALTER UPDATE, ALTER DELETE, TRUNCATE ON ${CH_DATABASE}.clustering_similiarities_data TO crawler;
GRANT ON CLUSTER ${CH_CLUSTER} ALTER UPDATE ON ${CH_DATABASE}.clustering_results_data TO crawler;
GRANT ON CLUSTER ${CH_CLUSTER} dictGet ON ${CH_DICT_DATABASE}.geolite_asn_blocks_ipv6 TO crawler;
GRANT ON CLUSTER ${CH_CLUSTER} dictGet ON ${CH_DICT_DATABASE}.geolite_asn_blocks_ipv4 TO crawler;
CREATE DATABASE IF NOT EXISTS ${CH_DATABASE} ON CLUSTER ${CH_CLUSTER};