[GH-ISSUE #228] failed migration in #226 #232

Closed
opened 2026-04-11 09:11:00 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @kapdon on GitHub (Mar 15, 2026).
Original GitHub issue: https://github.com/RayLabsHQ/gitea-mirror/issues/228

Originally assigned to: @arunavo4 on GitHub.

migration has failed on this update.

3749 | const staticQuery = this.dialect.sqlToQuery(query);
3750 | try {
3751 | return this.prepareOneTimeQuery(staticQuery, undefined, "run", false).run();
3752 | throw new DrizzleError({ cause: err, message: Failed to run the query '${staticQuery.sql}' });
^
DrizzleError: Failed to run the query 'ALTER TABLE repositories ADD imported_at integer DEFAULT (unixepoch()) NOT NULL;'
at run (/app/dist/scripts/repair-mirrored-repos.js:3752:13)
at migrate (/app/dist/scripts/repair-mirrored-repos.js:2726:24)
at migrate (/app/dist/scripts/repair-mirrored-repos.js:3985:21)
at runDrizzleMigrations (/app/dist/scripts/repair-mirrored-repos.js:18054:14)
at /app/dist/scripts/repair-mirrored-repos.js:18078:23
at loadAndEvaluateModule (2:1)
133 | return this.#raw.values();
134 | }
135 | #rawNoArgs() {
136 | return this.#raw.raw();
137 | }
138 | return this.#raw.run(internalFieldTuple), createChangesObject();
^
SQLiteError: Cannot add a column with non-constant default
Originally created by @kapdon on GitHub (Mar 15, 2026). Original GitHub issue: https://github.com/RayLabsHQ/gitea-mirror/issues/228 Originally assigned to: @arunavo4 on GitHub. migration has failed on this update. ``` 3749 | const staticQuery = this.dialect.sqlToQuery(query); 3750 | try { 3751 | return this.prepareOneTimeQuery(staticQuery, undefined, "run", false).run(); 3752 | throw new DrizzleError({ cause: err, message: Failed to run the query '${staticQuery.sql}' }); ^ DrizzleError: Failed to run the query 'ALTER TABLE repositories ADD imported_at integer DEFAULT (unixepoch()) NOT NULL;' at run (/app/dist/scripts/repair-mirrored-repos.js:3752:13) at migrate (/app/dist/scripts/repair-mirrored-repos.js:2726:24) at migrate (/app/dist/scripts/repair-mirrored-repos.js:3985:21) at runDrizzleMigrations (/app/dist/scripts/repair-mirrored-repos.js:18054:14) at /app/dist/scripts/repair-mirrored-repos.js:18078:23 at loadAndEvaluateModule (2:1) 133 | return this.#raw.values(); 134 | } 135 | #rawNoArgs() { 136 | return this.#raw.raw(); 137 | } 138 | return this.#raw.run(internalFieldTuple), createChangesObject(); ^ SQLiteError: Cannot add a column with non-constant default ```
GiteaMirror added the bug label 2026-04-11 09:11:00 -05:00
Author
Owner

@arunavo4 commented on GitHub (Mar 15, 2026):

Was not expecting a drizzle-kit migration to fail.

<!-- gh-comment-id:4062403781 --> @arunavo4 commented on GitHub (Mar 15, 2026): Was not expecting a drizzle-kit migration to fail.
Author
Owner

@arunavo4 commented on GitHub (Mar 15, 2026):

@kapdon try the new v3.13.2 once the docker action is done

<!-- gh-comment-id:4062580456 --> @arunavo4 commented on GitHub (Mar 15, 2026): @kapdon try the new v3.13.2 once the docker action is done
Author
Owner

@kapdon commented on GitHub (Mar 15, 2026):

tested #230 and working.

<!-- gh-comment-id:4062584379 --> @kapdon commented on GitHub (Mar 15, 2026): tested #230 and working.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea-mirror#232