MCPcopy Index your code
hub / github.com/codebymitch/TitanBot / verifySchemaVersion

Method verifySchemaVersion

src/utils/postgresDatabase.js:194–218  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

192 }
193
194 async verifySchemaVersion() {
195 const latest = await this.getLatestSchemaVersion();
196 const expectedVersion = Number(pgConfig.migration.expectedVersion);
197
198 if (!latest) {
199 return {
200 ok: false,
201 expectedVersion,
202 currentVersion: null,
203 reason: 'MISSING_MIGRATION_VERSION'
204 };
205 }
206
207 const currentVersion = Number(latest.version);
208 const isValid = currentVersion === expectedVersion;
209
210 return {
211 ok: isValid,
212 expectedVersion,
213 currentVersion,
214 label: latest.label,
215 appliedAt: latest.applied_at,
216 reason: isValid ? 'OK' : 'SCHEMA_VERSION_MISMATCH'
217 };
218 }
219
220 async createTables() {
221 const tables = [

Callers 1

_establishConnectionMethod · 0.95

Calls 1

Tested by

no test coverage detected