Remove clickhouse check requiring elevated permissions (#12006)
This check was un-necessary, it will fail after in anycase. Let's leave it to the user to create the DB
This commit is contained in:
@ -20,19 +20,6 @@ const clickHouseUrl = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
async function ensureDatabaseExists() {
|
|
||||||
const [url, database] = clickHouseUrl().split(/\/(?=[^/]*$)/);
|
|
||||||
const client = createClient({
|
|
||||||
url,
|
|
||||||
});
|
|
||||||
|
|
||||||
await client.command({
|
|
||||||
query: `CREATE DATABASE IF NOT EXISTS "${database}"`,
|
|
||||||
});
|
|
||||||
|
|
||||||
await client.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
async function ensureMigrationTable(client: ClickHouseClient) {
|
async function ensureMigrationTable(client: ClickHouseClient) {
|
||||||
await client.command({
|
await client.command({
|
||||||
query: `
|
query: `
|
||||||
@ -71,8 +58,6 @@ async function runMigrations() {
|
|||||||
const dir = path.join(__dirname);
|
const dir = path.join(__dirname);
|
||||||
const files = fs.readdirSync(dir).filter((f) => f.endsWith('.sql'));
|
const files = fs.readdirSync(dir).filter((f) => f.endsWith('.sql'));
|
||||||
|
|
||||||
await ensureDatabaseExists();
|
|
||||||
|
|
||||||
const client = createClient({
|
const client = createClient({
|
||||||
url: clickHouseUrl(),
|
url: clickHouseUrl(),
|
||||||
clickhouse_settings: {
|
clickhouse_settings: {
|
||||||
|
|||||||
Reference in New Issue
Block a user