MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / isLocalV1Database

Function isLocalV1Database

apps/local/src/db/v1-v2-migration.ts:155–162  ·  view source on GitHub ↗
(client: Client)

Source from the content-addressed store, hash-verified

153 columns.has(column) ? `${quoteIdent(table)}.${quoteIdent(column)}` : "NULL";
154
155const isLocalV1Database = async (client: Client): Promise<boolean> => {
156 if (!(await tableExists(client, "source"))) return false;
157 const sourceColumns = await columnNames(client, "source");
158 if (!sourceColumns.has("scope_id")) return false;
159 if (!(await tableExists(client, "integration"))) return true;
160 const connectionColumns = await columnNames(client, "connection");
161 return !connectionColumns.has("tenant") || connectionColumns.has("scope_id");
162};
163
164// ---------------------------------------------------------------------------
165// Data-migration-ledger gate.

Callers 1

Calls 2

tableExistsFunction · 0.70
columnNamesFunction · 0.70

Tested by

no test coverage detected