@biorate/migrations 1.39.0 → 1.42.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biorate/migrations",
3
- "version": "1.39.0",
3
+ "version": "1.42.1",
4
4
  "description": "Migrations tools",
5
5
  "main": "dist",
6
6
  "scripts": {
@@ -23,21 +23,21 @@
23
23
  "author": "llevkin",
24
24
  "license": "MIT",
25
25
  "dependencies": {
26
- "@biorate/clickhouse": "1.39.0",
27
- "@biorate/config": "1.38.4",
28
- "@biorate/config-loader": "1.38.4",
29
- "@biorate/config-loader-env": "1.38.4",
30
- "@biorate/config-loader-fs": "1.38.4",
31
- "@biorate/config-loader-vault": "1.38.4",
32
- "@biorate/connector": "1.38.4",
26
+ "@biorate/clickhouse": "1.42.1",
27
+ "@biorate/config": "1.42.1",
28
+ "@biorate/config-loader": "1.42.1",
29
+ "@biorate/config-loader-env": "1.42.1",
30
+ "@biorate/config-loader-fs": "1.42.1",
31
+ "@biorate/config-loader-vault": "1.42.1",
32
+ "@biorate/connector": "1.42.1",
33
33
  "@biorate/errors": "1.28.0",
34
- "@biorate/inversion": "1.30.12",
35
- "@biorate/kafkajs": "1.38.4",
36
- "@biorate/minio": "1.38.4",
37
- "@biorate/mongodb": "1.38.4",
38
- "@biorate/sequelize": "1.38.4",
34
+ "@biorate/inversion": "1.42.1",
35
+ "@biorate/kafkajs": "1.42.1",
36
+ "@biorate/minio": "1.42.1",
37
+ "@biorate/mongodb": "1.42.1",
38
+ "@biorate/sequelize": "1.42.1",
39
39
  "@biorate/tools": "1.28.0",
40
- "@biorate/vault": "1.38.4"
40
+ "@biorate/vault": "1.42.1"
41
41
  },
42
- "gitHead": "f99a971871a4609aa58735b76e123538c960aeb1"
42
+ "gitHead": "2d5874bd199b8ef387be4f4381c906966702799f"
43
43
  }
@@ -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 ${tableName} (
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 ${tableName} WHERE name = {name:String};`, {
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 ${tableName} (name) VALUES ({name:String})`, {
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);