devperf/backend/drizzle/meta/0000_snapshot.json
zyc 44464dd334 feat: DevPerf Dashboard 研发人效看板 v1.0
- 后端:Bun + Hono + Drizzle ORM + SQLite
- 前端:Vue 3 + Naive UI + ECharts
- 项目管理:创建项目 + 绑定 Git 仓库
- OKR 系统:目标/关键结果 CRUD + 进度追踪
- Git 同步:Gitea API 自动同步 commit/PR + 作者关联
- 数据看板:项目 OKR 进度 + KR 状态分布 + 代码活动
- 权限体系:admin/manager/developer/viewer 四级
- Docker 部署:docker-compose + nginx

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 17:57:14 +08:00

1257 lines
31 KiB
JSON

{
"version": "6",
"dialect": "sqlite",
"id": "eee6e44b-0f30-4220-a039-e81be56141d9",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"author_mappings": {
"name": "author_mappings",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"git_email": {
"name": "git_email",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"git_username": {
"name": "git_username",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"uniq_mapping_email": {
"name": "uniq_mapping_email",
"columns": [
"git_email"
],
"isUnique": true
},
"uniq_mapping_username": {
"name": "uniq_mapping_username",
"columns": [
"git_username"
],
"isUnique": true
}
},
"foreignKeys": {
"author_mappings_user_id_users_id_fk": {
"name": "author_mappings_user_id_users_id_fk",
"tableFrom": "author_mappings",
"tableTo": "users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"git_commits": {
"name": "git_commits",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"repo_name": {
"name": "repo_name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"sha": {
"name": "sha",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"author_email": {
"name": "author_email",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"author_name": {
"name": "author_name",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"message": {
"name": "message",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"additions": {
"name": "additions",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": 0
},
"deletions": {
"name": "deletions",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": 0
},
"committed_at": {
"name": "committed_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"git_commits_sha_unique": {
"name": "git_commits_sha_unique",
"columns": [
"sha"
],
"isUnique": true
},
"uniq_commits_sha": {
"name": "uniq_commits_sha",
"columns": [
"sha"
],
"isUnique": true
},
"idx_commits_user": {
"name": "idx_commits_user",
"columns": [
"user_id"
],
"isUnique": false
},
"idx_commits_repo": {
"name": "idx_commits_repo",
"columns": [
"repo_name"
],
"isUnique": false
},
"idx_commits_committed_at": {
"name": "idx_commits_committed_at",
"columns": [
"committed_at"
],
"isUnique": false
}
},
"foreignKeys": {
"git_commits_user_id_users_id_fk": {
"name": "git_commits_user_id_users_id_fk",
"tableFrom": "git_commits",
"tableTo": "users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"git_prs": {
"name": "git_prs",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"repo_name": {
"name": "repo_name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"external_id": {
"name": "external_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"author_username": {
"name": "author_username",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"state": {
"name": "state",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"additions": {
"name": "additions",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": 0
},
"deletions": {
"name": "deletions",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": 0
},
"review_comments": {
"name": "review_comments",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"merged_at": {
"name": "merged_at",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"merge_time_hours": {
"name": "merge_time_hours",
"type": "real",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"idx_prs_user": {
"name": "idx_prs_user",
"columns": [
"user_id"
],
"isUnique": false
},
"idx_prs_repo": {
"name": "idx_prs_repo",
"columns": [
"repo_name"
],
"isUnique": false
},
"idx_prs_state": {
"name": "idx_prs_state",
"columns": [
"state"
],
"isUnique": false
}
},
"foreignKeys": {
"git_prs_user_id_users_id_fk": {
"name": "git_prs_user_id_users_id_fk",
"tableFrom": "git_prs",
"tableTo": "users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"key_results": {
"name": "key_results",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"objective_id": {
"name": "objective_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"target_value": {
"name": "target_value",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"current_value": {
"name": "current_value",
"type": "real",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": 0
},
"unit": {
"name": "unit",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"weight": {
"name": "weight",
"type": "real",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": 1
},
"linked_plane_cycle_id": {
"name": "linked_plane_cycle_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"linked_plane_module_id": {
"name": "linked_plane_module_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"idx_kr_objective": {
"name": "idx_kr_objective",
"columns": [
"objective_id"
],
"isUnique": false
}
},
"foreignKeys": {
"key_results_objective_id_objectives_id_fk": {
"name": "key_results_objective_id_objectives_id_fk",
"tableFrom": "key_results",
"tableTo": "objectives",
"columnsFrom": [
"objective_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"milestones": {
"name": "milestones",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"plane_module_id": {
"name": "plane_module_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"target_date": {
"name": "target_date",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"total_issues": {
"name": "total_issues",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": 0
},
"completed_issues": {
"name": "completed_issues",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"idx_milestone_project": {
"name": "idx_milestone_project",
"columns": [
"project_id"
],
"isUnique": false
}
},
"foreignKeys": {
"milestones_project_id_projects_id_fk": {
"name": "milestones_project_id_projects_id_fk",
"tableFrom": "milestones",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"objectives": {
"name": "objectives",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"owner_id": {
"name": "owner_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"period": {
"name": "period",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"progress": {
"name": "progress",
"type": "real",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"idx_obj_period": {
"name": "idx_obj_period",
"columns": [
"period"
],
"isUnique": false
},
"idx_obj_owner": {
"name": "idx_obj_owner",
"columns": [
"owner_id"
],
"isUnique": false
}
},
"foreignKeys": {
"objectives_owner_id_users_id_fk": {
"name": "objectives_owner_id_users_id_fk",
"tableFrom": "objectives",
"tableTo": "users",
"columnsFrom": [
"owner_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"objectives_project_id_projects_id_fk": {
"name": "objectives_project_id_projects_id_fk",
"tableFrom": "objectives",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"projects": {
"name": "projects",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"plane_project_id": {
"name": "plane_project_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"identifier": {
"name": "identifier",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"last_synced_at": {
"name": "last_synced_at",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"uniq_projects_plane_id": {
"name": "uniq_projects_plane_id",
"columns": [
"plane_project_id"
],
"isUnique": true
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"sprint_snapshots": {
"name": "sprint_snapshots",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"plane_cycle_id": {
"name": "plane_cycle_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"start_date": {
"name": "start_date",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"end_date": {
"name": "end_date",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"total_points": {
"name": "total_points",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": 0
},
"completed_points": {
"name": "completed_points",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": 0
},
"total_issues": {
"name": "total_issues",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": 0
},
"completed_issues": {
"name": "completed_issues",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": 0
},
"burndown_data": {
"name": "burndown_data",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"idx_sprint_project": {
"name": "idx_sprint_project",
"columns": [
"project_id"
],
"isUnique": false
},
"idx_sprint_status": {
"name": "idx_sprint_status",
"columns": [
"status"
],
"isUnique": false
}
},
"foreignKeys": {
"sprint_snapshots_project_id_projects_id_fk": {
"name": "sprint_snapshots_project_id_projects_id_fk",
"tableFrom": "sprint_snapshots",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"sync_logs": {
"name": "sync_logs",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"source": {
"name": "source",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"message": {
"name": "message",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"records_processed": {
"name": "records_processed",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": 0
},
"synced_at": {
"name": "synced_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"task_snapshots": {
"name": "task_snapshots",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"plane_issue_id": {
"name": "plane_issue_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"sprint_id": {
"name": "sprint_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"priority": {
"name": "priority",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"assignee_id": {
"name": "assignee_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"story_points": {
"name": "story_points",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"completed_at": {
"name": "completed_at",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"due_date": {
"name": "due_date",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"labels": {
"name": "labels",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"idx_task_project": {
"name": "idx_task_project",
"columns": [
"project_id"
],
"isUnique": false
},
"idx_task_sprint": {
"name": "idx_task_sprint",
"columns": [
"sprint_id"
],
"isUnique": false
},
"idx_task_assignee": {
"name": "idx_task_assignee",
"columns": [
"assignee_id"
],
"isUnique": false
},
"idx_task_status": {
"name": "idx_task_status",
"columns": [
"status"
],
"isUnique": false
}
},
"foreignKeys": {
"task_snapshots_project_id_projects_id_fk": {
"name": "task_snapshots_project_id_projects_id_fk",
"tableFrom": "task_snapshots",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"task_snapshots_sprint_id_sprint_snapshots_id_fk": {
"name": "task_snapshots_sprint_id_sprint_snapshots_id_fk",
"tableFrom": "task_snapshots",
"tableTo": "sprint_snapshots",
"columnsFrom": [
"sprint_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"task_snapshots_assignee_id_users_id_fk": {
"name": "task_snapshots_assignee_id_users_id_fk",
"tableFrom": "task_snapshots",
"tableTo": "users",
"columnsFrom": [
"assignee_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"users": {
"name": "users",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"plane_user_id": {
"name": "plane_user_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"display_name": {
"name": "display_name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"git_username": {
"name": "git_username",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"role": {
"name": "role",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"password_hash": {
"name": "password_hash",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"login_attempts": {
"name": "login_attempts",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": 0
},
"locked_until": {
"name": "locked_until",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"users_email_unique": {
"name": "users_email_unique",
"columns": [
"email"
],
"isUnique": true
},
"uniq_users_email": {
"name": "uniq_users_email",
"columns": [
"email"
],
"isUnique": true
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
}
},
"views": {},
"enums": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
},
"internal": {
"indexes": {}
}
}