MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / parseMigrationFilename

Function parseMigrationFilename

server/src/db/migrate.ts:25–40  ·  view source on GitHub ↗

* Parse and validate migration filename

(filename: string)

Source from the content-addressed store, hash-verified

23 * Parse and validate migration filename
24 */
25function parseMigrationFilename(filename: string): { version: number; description: string } | null {
26 const match = filename.match(MIGRATION_FILENAME_PATTERN);
27 if (!match) {
28 return null;
29 }
30
31 const version = parseInt(match[1], 10);
32 if (isNaN(version)) {
33 return null;
34 }
35
36 return {
37 version,
38 description: match[2],
39 };
40}
41
42/**
43 * Load all migration files

Callers 1

loadMigrationsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected