clickhouse-migrations 0.1.0 → 0.1.1
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 +6 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ npm install --global clickhouse-migrations
|
|
|
13
13
|
|
|
14
14
|
Create a directory, where migrations will be stored. It will be used as the value for the `--migrations-home` option.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
In the directory, create migrations - which should be named like: `1_`some_text`.sql`, `2_`other_text`.sql`, ... `10_`more_test`.sql`. What is important here: migration versions followed by underscore - `1_`, `2_`, ...`10_`..., and file extension `.sql`. Any text can follow by version number. The version number should increase for every next migration.
|
|
17
17
|
|
|
18
18
|
For migrations' content should be used correct SQL ClickHouse queries. A few queries can be used in one migration file. Every query should end with `;`. The queries could be idempotent - for example: `CREATE TABLE IF NOT EXISTS table ...;` Comments should start with `--- `.
|
|
19
19
|
|
|
@@ -22,7 +22,8 @@ For migrations' content should be used correct SQL ClickHouse queries. A few que
|
|
|
22
22
|
$ clickhouse-migrations migrate <options>
|
|
23
23
|
|
|
24
24
|
Required options
|
|
25
|
-
--host=<name> Clickhouse hostname in
|
|
25
|
+
--host=<name> Clickhouse hostname, in
|
|
26
|
+
format https://clichouse
|
|
26
27
|
--port=<number> Port
|
|
27
28
|
--user=<name> Username
|
|
28
29
|
--pass=<password> Password
|
|
@@ -30,6 +31,8 @@ For migrations' content should be used correct SQL ClickHouse queries. A few que
|
|
|
30
31
|
--migrations-home=<dir> Migrations' directory
|
|
31
32
|
|
|
32
33
|
Examples
|
|
33
|
-
clickhouse-migrations migrate --host=http://localhost
|
|
34
|
+
clickhouse-migrations migrate --host=http://localhost
|
|
35
|
+
--port=8123 --user=default --pass=''
|
|
36
|
+
--db-name=analytics --migrations-home=/app/clickhouse/migrations
|
|
34
37
|
|
|
35
38
|
```
|