clickhouse-migrations 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -4
- package/lib/migrate.js +8 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,13 +26,23 @@ For migrations' content should be used correct SQL ClickHouse queries. A few que
|
|
|
26
26
|
format https://clichouse
|
|
27
27
|
--port=<number> Port
|
|
28
28
|
--user=<name> Username
|
|
29
|
-
--
|
|
30
|
-
--db
|
|
29
|
+
--password=<password> Password
|
|
30
|
+
--db=<name> Database name
|
|
31
31
|
--migrations-home=<dir> Migrations' directory
|
|
32
32
|
|
|
33
|
+
Environment variables
|
|
34
|
+
instead options can be used environment variables
|
|
35
|
+
CH_MIGRATIONS_HOST Clickhouse hostname (--host)
|
|
36
|
+
CH_MIGRATIONS_PORT Port (--port)
|
|
37
|
+
CH_MIGRATIONS_USER Username (--user)
|
|
38
|
+
CH_MIGRATIONS_PASSWORD Password (--password)
|
|
39
|
+
CH_MIGRATIONS_DB Database name (--db)
|
|
40
|
+
CH_MIGRATIONS_HOME Migrations' directory
|
|
41
|
+
(--migrations-home)
|
|
42
|
+
|
|
33
43
|
Examples
|
|
34
44
|
clickhouse-migrations migrate --host=http://localhost
|
|
35
|
-
--port=8123 --user=default --
|
|
36
|
-
--db
|
|
45
|
+
--port=8123 --user=default --password=''
|
|
46
|
+
--db=analytics --migrations-home=/app/clickhouse/migrations
|
|
37
47
|
|
|
38
48
|
```
|
package/lib/migrate.js
CHANGED
|
@@ -304,20 +304,20 @@ var migration = function (migrations_home, host, port, username, password, db_na
|
|
|
304
304
|
}); };
|
|
305
305
|
var migrate = function () {
|
|
306
306
|
var program = new Command();
|
|
307
|
-
program.name('clickhouse-migrations').description('ClickHouse migrations.').version('1.
|
|
307
|
+
program.name('clickhouse-migrations').description('ClickHouse migrations.').version('0.1.4');
|
|
308
308
|
program
|
|
309
309
|
.command('migrate')
|
|
310
310
|
.description('apply migrations.')
|
|
311
|
-
.requiredOption('--host <name>', 'clickhouse hostname in format http://clickhouse')
|
|
312
|
-
.requiredOption('--port <number>', 'port')
|
|
313
|
-
.requiredOption('--user <name>', 'username')
|
|
314
|
-
.requiredOption('--
|
|
315
|
-
.requiredOption('--db
|
|
316
|
-
.requiredOption('--migrations-home <dir>', 'migrations directory')
|
|
311
|
+
.requiredOption('--host <name>', 'clickhouse hostname in format http://clickhouse', process.env.CH_MIGRATIONS_HOST)
|
|
312
|
+
.requiredOption('--port <number>', 'port', process.env.CH_MIGRATIONS_PORT)
|
|
313
|
+
.requiredOption('--user <name>', 'username', process.env.CH_MIGRATIONS_USER)
|
|
314
|
+
.requiredOption('--password <password>', 'password', process.env.CH_MIGRATIONS_PASSWORD)
|
|
315
|
+
.requiredOption('--db <name>', 'database name', process.env.CH_MIGRATIONS_DB)
|
|
316
|
+
.requiredOption('--migrations-home <dir>', 'migrations directory', process.env.CH_MIGRATIONS_HOME)
|
|
317
317
|
.action(function (options) { return __awaiter(void 0, void 0, void 0, function () {
|
|
318
318
|
return __generator(this, function (_a) {
|
|
319
319
|
switch (_a.label) {
|
|
320
|
-
case 0: return [4 /*yield*/, migration(options.migrationsHome, options.host, options.port, options.user, options.
|
|
320
|
+
case 0: return [4 /*yield*/, migration(options.migrationsHome, options.host, options.port, options.user, options.password, options.db)];
|
|
321
321
|
case 1:
|
|
322
322
|
_a.sent();
|
|
323
323
|
return [2 /*return*/];
|