@mastra/clickhouse 1.5.0 → 1.5.1-alpha.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @mastra/clickhouse
2
2
 
3
+ ## 1.5.1-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed `mastra dev` repeatedly reporting `MIGRATION REQUIRED` on ClickHouse Cloud after `mastra migrate` had already run successfully. The observability migration check now recognizes the engine-name variants that ClickHouse Cloud and replicated clusters use in place of `ReplacingMergeTree`. ([#15623](https://github.com/mastra-ai/mastra/pull/15623))
8
+
9
+ - Updated dependencies [[`f112db1`](https://github.com/mastra-ai/mastra/commit/f112db179557ae9b5a0f1d25dc47f928d7d61cd9), [`21d9706`](https://github.com/mastra-ai/mastra/commit/21d970604d89eee970cbf8013d26d7551aff6ea5)]:
10
+ - @mastra/core@1.26.1-alpha.0
11
+
3
12
  ## 1.5.0
4
13
 
5
14
  ### Minor Changes
@@ -3,7 +3,7 @@ name: mastra-clickhouse
3
3
  description: Documentation for @mastra/clickhouse. Use when working with @mastra/clickhouse APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/clickhouse"
6
- version: "1.5.0"
6
+ version: "1.5.1-alpha.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.5.0",
2
+ "version": "1.5.1-alpha.0",
3
3
  "package": "@mastra/clickhouse",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -4983,6 +4983,9 @@ var SIGNAL_MIGRATIONS = [
4983
4983
  { table: TABLE_SCORE_EVENTS, createDDL: SCORE_EVENTS_DDL, idColumn: "scoreId" },
4984
4984
  { table: TABLE_FEEDBACK_EVENTS, createDDL: FEEDBACK_EVENTS_DDL, idColumn: "feedbackId" }
4985
4985
  ];
4986
+ function isReplacingMergeTreeEngine(engine) {
4987
+ return engine.endsWith("ReplacingMergeTree");
4988
+ }
4986
4989
  async function getTableEngine(client, table) {
4987
4990
  const result = await client.query({
4988
4991
  query: `SELECT engine FROM system.tables WHERE database = currentDatabase() AND name = {table:String}`,
@@ -5020,7 +5023,7 @@ async function checkSignalTablesMigrationStatus(client) {
5020
5023
  const tables = [];
5021
5024
  for (const { table, idColumn } of SIGNAL_MIGRATIONS) {
5022
5025
  const engine = await getTableEngine(client, table);
5023
- if (!engine || engine === "ReplacingMergeTree") {
5026
+ if (!engine || isReplacingMergeTreeEngine(engine)) {
5024
5027
  continue;
5025
5028
  }
5026
5029
  tables.push({ table, engine, idColumn });
@@ -5033,7 +5036,7 @@ async function checkSignalTablesMigrationStatus(client) {
5033
5036
  async function migrateSignalTables(client, logger) {
5034
5037
  for (const { table, createDDL, idColumn } of SIGNAL_MIGRATIONS) {
5035
5038
  const engine = await getTableEngine(client, table);
5036
- if (!engine || engine === "ReplacingMergeTree") continue;
5039
+ if (!engine || isReplacingMergeTreeEngine(engine)) continue;
5037
5040
  logger?.info?.(`Migrating ${table} from ${engine} to ReplacingMergeTree with ${idColumn} column`);
5038
5041
  const temp = `${table}_migrating_${Date.now()}`;
5039
5042
  try {