{"id":26597199,"url":"https://github.com/oaklight/onehub-database-sync","last_synced_at":"2026-05-09T14:44:21.478Z","repository":{"id":282969200,"uuid":"950262160","full_name":"Oaklight/onehub-database-sync","owner":"Oaklight","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-17T22:18:54.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T23:27:08.556Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Oaklight.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-17T22:17:33.000Z","updated_at":"2025-03-17T22:18:57.000Z","dependencies_parsed_at":"2025-03-17T23:27:18.518Z","dependency_job_id":null,"html_url":"https://github.com/Oaklight/onehub-database-sync","commit_stats":null,"previous_names":["oaklight/onehub-database-sync"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oaklight%2Fonehub-database-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oaklight%2Fonehub-database-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oaklight%2Fonehub-database-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oaklight%2Fonehub-database-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Oaklight","download_url":"https://codeload.github.com/Oaklight/onehub-database-sync/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245141256,"owners_count":20567556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-23T17:32:00.271Z","updated_at":"2026-05-09T14:44:16.441Z","avatar_url":"https://github.com/Oaklight.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# One-Hub 数据库迁移工具\n\n本工具专为 MartialBE/one-hub 项目设计，提供 SQLite 和 PostgreSQL 数据库之间的双向同步功能，支持以下特性：\n\n## 功能特性\n\n- 针对 one-hub 数据库结构优化\n- SQLite 到 PostgreSQL 的迁移\n- PostgreSQL 到 SQLite 的同步\n- 云端 PostgreSQL 与本地 PostgreSQL 之间的双向同步\n- 自动处理 one-hub 特定数据类型转换\n\n## 适用版本\n\n- SQLite: 3.x\n- PostgreSQL: 16\n\n## 快速开始\n\n1. 复制 `config.toml.sample` 为 `config.toml` 并配置数据库连接信息\n2. 安装依赖：`pip install -r requirements.txt`\n3. 运行相应脚本：\n   - SQLite 到 PostgreSQL 迁移：`python migrate_sqlite_to_pg.py`\n   \u003c!-- - PostgreSQL 到 SQLite 同步：`python sync_pg_to_sqlite.py [cloud|local]` --\u003e\n   - PostgreSQL 双向同步：`python sync_pg.py [cloud-to-local|local-to-cloud]`\n\n## 配置说明\n\n配置文件 `config.toml` 包含以下配置项：\n\n- `database`: SQLite 数据库配置\n- `postgresql.cloud`: 云端 PostgreSQL 配置\n- `postgresql.local`: 本地 PostgreSQL 配置\n\n## 注意事项\n\n- 同步前请备份重要数据\n- 确保数据库版本兼容\n- 同步过程中请保持网络连接稳定\n\n## 许可证\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foaklight%2Fonehub-database-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foaklight%2Fonehub-database-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foaklight%2Fonehub-database-sync/lists"}