mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2025-12-10 05:26:44 +03:00
fix: resolve SQLite field mismatch for large starred repo imports (#90)
- Add missing database fields (language, description, mirroredLocation, destinationOrg) to repository operations - Add missing organization fields (publicRepositoryCount, privateRepositoryCount, forkRepositoryCount) to schema - Update GitRepo interface to include all required database fields - Fix GitHub data fetching functions to map all fields correctly - Update all sync endpoints (main, repository, organization, scheduler) to handle new fields This fixes the "SQLite query expected X values, received Y" error when importing large numbers (4.6k+) of starred repositories by ensuring all database fields are properly mapped from GitHub API responses through to database insertion.
This commit is contained in:
@@ -120,6 +120,8 @@ async function runScheduledSync(config: any): Promise<void> {
|
||||
cloneUrl: repo.cloneUrl,
|
||||
owner: repo.owner,
|
||||
organization: repo.organization,
|
||||
mirroredLocation: repo.mirroredLocation || "",
|
||||
destinationOrg: repo.destinationOrg || null,
|
||||
isPrivate: repo.isPrivate,
|
||||
isForked: repo.isForked,
|
||||
forkedFrom: repo.forkedFrom,
|
||||
@@ -129,6 +131,8 @@ async function runScheduledSync(config: any): Promise<void> {
|
||||
size: repo.size,
|
||||
hasLFS: repo.hasLFS,
|
||||
hasSubmodules: repo.hasSubmodules,
|
||||
language: repo.language || null,
|
||||
description: repo.description || null,
|
||||
defaultBranch: repo.defaultBranch,
|
||||
visibility: repo.visibility,
|
||||
status: 'imported',
|
||||
@@ -397,6 +401,8 @@ async function performInitialAutoStart(): Promise<void> {
|
||||
cloneUrl: repo.cloneUrl,
|
||||
owner: repo.owner,
|
||||
organization: repo.organization,
|
||||
mirroredLocation: repo.mirroredLocation || "",
|
||||
destinationOrg: repo.destinationOrg || null,
|
||||
isPrivate: repo.isPrivate,
|
||||
isForked: repo.isForked,
|
||||
forkedFrom: repo.forkedFrom,
|
||||
@@ -406,6 +412,8 @@ async function performInitialAutoStart(): Promise<void> {
|
||||
size: repo.size,
|
||||
hasLFS: repo.hasLFS,
|
||||
hasSubmodules: repo.hasSubmodules,
|
||||
language: repo.language || null,
|
||||
description: repo.description || null,
|
||||
defaultBranch: repo.defaultBranch,
|
||||
visibility: repo.visibility,
|
||||
status: 'imported',
|
||||
|
||||
Reference in New Issue
Block a user