Implement Backend API, MCP Server, and Gitea integration
All checks were successful
Build and Push Backend / build (push) Successful in 5s
All checks were successful
Build and Push Backend / build (push) Successful in 5s
- Add REST API routes for projects, tasks, and agents (CRUD operations) - Implement MCP Server with 4 core tools: - get_next_task: Assign tasks to agents - update_task_status: Update task states - create_branch: Create Git branches via Gitea API - create_pull_request: Create PRs via Gitea API - Add Gitea API client for repository operations - Fix database migration error handling for existing tables - Connect all routes to Bun.serve() main server Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -25,7 +25,22 @@ export async function runMigrations() {
|
||||
console.log('✅ Migrations completed successfully')
|
||||
await connection.end()
|
||||
return true
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
// If table already exists, it's not a fatal error
|
||||
const errorMessage = error?.message || String(error)
|
||||
const errorCode = error?.code || error?.cause?.code
|
||||
const errorErrno = error?.errno || error?.cause?.errno
|
||||
|
||||
if (
|
||||
errorCode === 'ER_TABLE_EXISTS_ERROR' ||
|
||||
errorErrno === 1050 ||
|
||||
errorMessage.includes('already exists')
|
||||
) {
|
||||
console.log('⚠️ Tables already exist, skipping migrations')
|
||||
await connection.end()
|
||||
return true
|
||||
}
|
||||
|
||||
console.error('❌ Migration failed:', error)
|
||||
await connection.end()
|
||||
throw error
|
||||
|
||||
Reference in New Issue
Block a user