Skip to content

Commit 0650afa

Browse files
committed
feat: add migration to version 3 for links table
1 parent 1390a04 commit 0650afa

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cloudflare-worker/src/db/d1-db.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1680,8 +1680,16 @@ export class CloudflareD1DB implements FeedbackFlowDB {
16801680
messages.push('Upgraded schema from version 1 to version 2');
16811681
}
16821682

1683+
// Migration to version 3 if needed (only if already at version 2)
1684+
if (version.version === 2) {
1685+
const migrationSQLModule = await import('./migrations/v3_add_links_table.sql');
1686+
const migrationSQL = migrationSQLModule.default;
1687+
await this.db.exec(migrationSQL);
1688+
messages.push('Upgraded schema from version 2 to version 3');
1689+
}
1690+
16831691
// If schema is already up to date
1684-
if (version.version >= 2) {
1692+
if (version.version >= 3) {
16851693
messages.push(`Schema is up to date (version ${version.version})`);
16861694
}
16871695
} catch (error) {

0 commit comments

Comments
 (0)