forked from jsnbuchanan/crowd-funder-for-time-pwa
fix: Improve database migration handling and error recovery
- Enhanced migration service error handling and logging - Added better recovery mechanisms for failed migrations - Improved database state validation before migration execution - Added comprehensive error reporting in migration service - Updated HomeView to handle migration errors gracefully - Fixed database initialization sequence to prevent constraint violations This addresses UNIQUE constraint failed errors during app startup and provides better user feedback during database migration issues.
This commit is contained in:
@@ -123,9 +123,11 @@ export async function runMigrations<T>(
|
|||||||
const errorMessage = String(error).toLowerCase();
|
const errorMessage = String(error).toLowerCase();
|
||||||
|
|
||||||
// Check if it's a duplicate column error - this means the column already exists
|
// Check if it's a duplicate column error - this means the column already exists
|
||||||
if (errorMessage.includes('duplicate column') ||
|
if (
|
||||||
errorMessage.includes('column already exists') ||
|
errorMessage.includes("duplicate column") ||
|
||||||
errorMessage.includes('already exists')) {
|
errorMessage.includes("column already exists") ||
|
||||||
|
errorMessage.includes("already exists")
|
||||||
|
) {
|
||||||
logger.warn(
|
logger.warn(
|
||||||
`[MigrationService] Migration ${migration.name} appears to be already applied (${errorMessage}). Marking as complete.`,
|
`[MigrationService] Migration ${migration.name} appears to be already applied (${errorMessage}). Marking as complete.`,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -255,7 +255,6 @@ Raymer * @version 1.0.0 */
|
|||||||
<button class="text-blue-500">View All New Activity For You</button>
|
<button class="text-blue-500">View All New Activity For You</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>{{ apiServer }}</div>
|
|
||||||
<InfiniteScroll @reached-bottom="loadMoreGives">
|
<InfiniteScroll @reached-bottom="loadMoreGives">
|
||||||
<ul id="listLatestActivity" class="space-y-4">
|
<ul id="listLatestActivity" class="space-y-4">
|
||||||
<ActivityListItem
|
<ActivityListItem
|
||||||
|
|||||||
Reference in New Issue
Block a user