@biorate/migrations 1.39.0 → 1.39.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/.nyc_output/{f25727ee-6cc4-482c-ad59-a46164df9eb3.json → 3ef83b3b-66bd-4d39-9f29-25e31795d669.json} +1 -1
- package/.nyc_output/processinfo/{f25727ee-6cc4-482c-ad59-a46164df9eb3.json → 3ef83b3b-66bd-4d39-9f29-25e31795d669.json} +1 -1
- package/.nyc_output/processinfo/index.json +1 -1
- package/CHANGELOG.md +6 -0
- package/coverage/lcov-report/index.html +11 -11
- package/coverage/lcov-report/src/default.config.ts.html +1 -1
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/index.ts.html +1 -1
- package/coverage/lcov-report/src/root.ts.html +1 -1
- package/coverage/lcov-report/src/types/clickhouse.ts.html +15 -15
- package/coverage/lcov-report/src/types/index.html +11 -11
- package/coverage/lcov-report/src/types/index.ts.html +1 -1
- package/coverage/lcov-report/src/types/kafka.ts.html +1 -1
- package/coverage/lcov-report/src/types/migration.ts.html +3 -3
- package/coverage/lcov-report/src/types/minio.ts.html +1 -1
- package/coverage/lcov-report/src/types/mongodb.ts.html +1 -1
- package/coverage/lcov-report/src/types/sequelize.ts.html +1 -1
- package/coverage/lcov.info +10 -10
- package/dist/src/types/clickhouse.js +6 -6
- package/dist/src/types/clickhouse.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/types/clickhouse.ts +6 -6
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@biorate/migrations",
|
3
|
-
"version": "1.39.
|
3
|
+
"version": "1.39.1",
|
4
4
|
"description": "Migrations tools",
|
5
5
|
"main": "dist",
|
6
6
|
"scripts": {
|
@@ -39,5 +39,5 @@
|
|
39
39
|
"@biorate/tools": "1.28.0",
|
40
40
|
"@biorate/vault": "1.38.4"
|
41
41
|
},
|
42
|
-
"gitHead": "
|
42
|
+
"gitHead": "e16701e0755d259ab94f45fe1748faeca188269a"
|
43
43
|
}
|
package/src/types/clickhouse.ts
CHANGED
@@ -20,24 +20,24 @@ export class Clickhouse extends Migration {
|
|
20
20
|
async (config, connection, paths) => {
|
21
21
|
const tableName = this.config.get<string>('migrations.tableName', 'migrations');
|
22
22
|
const createQuery = `
|
23
|
-
CREATE TABLE IF NOT EXISTS
|
23
|
+
CREATE TABLE IF NOT EXISTS {tableName:Identifier} (
|
24
24
|
name String
|
25
25
|
)
|
26
26
|
ENGINE = MergeTree()
|
27
27
|
PRIMARY KEY (name);
|
28
28
|
`;
|
29
|
-
await connection.query(createQuery).toPromise();
|
29
|
+
await connection.query(createQuery, { params: { tableName } }).toPromise();
|
30
30
|
await this.forEachPath(paths, async (file, name) => {
|
31
31
|
const item = await connection
|
32
|
-
.query(`SELECT * FROM
|
33
|
-
params: { name },
|
32
|
+
.query(`SELECT * FROM {tableName:Identifier} WHERE name = {name:String};`, {
|
33
|
+
params: { name, tableName },
|
34
34
|
})
|
35
35
|
.toPromise();
|
36
36
|
if (item.length) return;
|
37
37
|
await connection.query(await fs.readFile(file, 'utf8')).toPromise();
|
38
38
|
await connection
|
39
|
-
.query(`INSERT INTO
|
40
|
-
params: { name },
|
39
|
+
.query(`INSERT INTO {tableName:Identifier} (name) VALUES ({name:String})`, {
|
40
|
+
params: { name, tableName },
|
41
41
|
})
|
42
42
|
.toPromise();
|
43
43
|
this.log(config.name, name);
|