Title: [BUG]使用 PG 时,如果model 在不同 schema 里面,则 nb orm upgrade 正常,而 nb orm check 会一直报错 · Issue #35 · nonebot/plugin-orm · GitHub
Open Graph Title: [BUG]使用 PG 时,如果model 在不同 schema 里面,则 nb orm upgrade 正常,而 nb orm check 会一直报错 · Issue #35 · nonebot/plugin-orm
X Title: [BUG]使用 PG 时,如果model 在不同 schema 里面,则 nb orm upgrade 正常,而 nb orm check 会一直报错 · Issue #35 · nonebot/plugin-orm
Description: 默认(public)下的 model 其他 schema(这里我设置了为 gv) 生成的迁移文件正常 数据库结构也正常 但是再次运行 bot(等效 nb orm check)会一直报错 目前临时解决办法是都放到 public 里面 日志 (flashbot) merlin@merlins-MacBook-Pro ~/HajimiBot dev ± nb orm revision -m "init" 使用 Python: /Users/merlin/Haj...
Open Graph Description: 默认(public)下的 model 其他 schema(这里我设置了为 gv) 生成的迁移文件正常 数据库结构也正常 但是再次运行 bot(等效 nb orm check)会一直报错 目前临时解决办法是都放到 public 里面 日志 (flashbot) merlin@merlins-MacBook-Pro ~/HajimiBot dev ± nb orm revisio...
X Description: 默认(public)下的 model 其他 schema(这里我设置了为 gv) 生成的迁移文件正常 数据库结构也正常 但是再次运行 bot(等效 nb orm check)会一直报错 目前临时解决办法是都放到 public 里面 日志 (flashbot) merlin@merlins-MacBook-Pro ~/HajimiBot dev ± nb orm revisio...
Opengraph URL: https://github.com/nonebot/plugin-orm/issues/35
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[BUG]使用 PG 时,如果model 在不同 schema 里面,则 nb orm upgrade 正常,而 nb orm check 会一直报错","articleBody":"默认(public)下的 model\n\n\u003cimg width=\"1322\" height=\"624\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/cb723673-1e81-4405-8a45-4ea05895929b\" />\n\n其他 schema(这里我设置了为 gv)\n\n\u003cimg width=\"1274\" height=\"1138\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/d548e94f-1a17-4a0f-9ade-161ec9cfa601\" />\n\n\u003cimg width=\"1364\" height=\"1098\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/8b2ffd11-4269-45f4-9a06-23815aeaa003\" />\n\n生成的迁移文件正常\n\n\u003cimg width=\"1560\" height=\"1684\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/d9d4bf22-74d9-4df7-8210-f34c3dfd05a1\" />\n\n数据库结构也正常\n\n\u003cimg width=\"550\" height=\"478\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/db13325c-918f-45c8-b258-85b414e3ad67\" />\n\n但是再次运行 bot(等效 nb orm check)会一直报错\n\n目前临时解决办法是都放到 public 里面\n\n\u003cdetails>\n\u003csummary>日志\u003c/summary>\n\n```log\n\n(flashbot) merlin@merlins-MacBook-Pro ~/HajimiBot dev ± nb orm revision -m \"init\"\n使用 Python: /Users/merlin/HajimiBot/.venv/bin/python\n02-04 17:48:37 [SUCCESS] nonebot | NoneBot is initializing...\n02-04 17:48:37 [INFO] nonebot | Current Env: prod\n02-04 17:48:38 [SUCCESS] nonebot | Succeeded to load plugin \"nonebot_plugin_localstore\"\n02-04 17:48:38 [SUCCESS] nonebot | Succeeded to load plugin \"group_verification\" from \"src.plugins.group_verification\"\n02-04 17:48:38 [SUCCESS] nonebot | Succeeded to load plugin \"nonebot_plugin_apscheduler\"\n02-04 17:48:38 [SUCCESS] nonebot | Succeeded to load plugin \"nonebot_plugin_orm\"\n Generating /var/folders/1z/9d78dbgj09x6mn3yc180bffw0000gn/T/tmpb4162o0x/a08596fdd90d_init.py ... done\n(flashbot) merlin@merlins-MacBook-Pro ~/HajimiBot dev ± nb run \n使用 Python: /Users/merlin/HajimiBot/.venv/bin/python\n02-04 17:49:15 [SUCCESS] nonebot | NoneBot is initializing...\n02-04 17:49:15 [INFO] nonebot | Current Env: prod\n02-04 17:49:16 [SUCCESS] nonebot | Succeeded to load plugin \"nonebot_plugin_localstore\"\n02-04 17:49:16 [SUCCESS] nonebot | Succeeded to load plugin \"group_verification\" from \"src.plugins.group_verification\"\n02-04 17:49:16 [SUCCESS] nonebot | Succeeded to load plugin \"nonebot_plugin_apscheduler\"\n02-04 17:49:16 [SUCCESS] nonebot | Succeeded to load plugin \"nonebot_plugin_orm\"\n02-04 17:49:16 [SUCCESS] nonebot | Running NoneBot...\n02-04 17:49:16 [SUCCESS] nonebot | Loaded adapters: OneBot V11\n02-04 17:49:16 [INFO] uvicorn | Started server process [89632]\n02-04 17:49:16 [INFO] uvicorn | Waiting for application startup.\n目标数据库未更新到最新迁移, 是否更新? [y/N]: y\n02-04 17:49:18 [WARNING] group_verification | 无法初始化B站会话: 登录凭证不存在或无效\n02-04 17:49:18 [WARNING] group_verification | B站登录凭证不存在或无效,请发送\"登录\"命令进行登录\n02-04 17:49:18 [INFO] nonebot_plugin_apscheduler | Scheduler Started\n02-04 17:49:18 [INFO] uvicorn | Application startup complete.\n02-04 17:49:18 [INFO] uvicorn | Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)\n02-04 17:49:19 [INFO] uvicorn | 127.0.0.1:57772 - \"WebSocket /onebot/v11/ws\" [accepted]\n02-04 17:49:19 [INFO] nonebot | OneBot V11 | Bot 3648991638 connected\n02-04 17:49:19 [INFO] websockets | connection open\n^C02-04 17:49:22 [INFO] uvicorn | Shutting down\n02-04 17:49:22 [WARNING] nonebot | OneBot V11 | WebSocket for Bot 3648991638 closed by peer\n02-04 17:49:22 [INFO] websockets | connection closed\n02-04 17:49:22 [INFO] uvicorn | Waiting for application shutdown.\n02-04 17:49:22 [INFO] nonebot_plugin_apscheduler | Scheduler Shutdown\n02-04 17:49:22 [INFO] uvicorn | Application shutdown complete.\n02-04 17:49:22 [INFO] uvicorn | Finished server process [89632]\n(flashbot) merlin@merlins-MacBook-Pro ~/HajimiBot dev ± nb run \n使用 Python: /Users/merlin/HajimiBot/.venv/bin/python\n02-04 17:49:29 [SUCCESS] nonebot | NoneBot is initializing...\n02-04 17:49:29 [INFO] nonebot | Current Env: prod\n02-04 17:49:29 [SUCCESS] nonebot | Succeeded to load plugin \"nonebot_plugin_apscheduler\"\n02-04 17:49:30 [SUCCESS] nonebot | Succeeded to load plugin \"nonebot_plugin_localstore\"\n02-04 17:49:30 [SUCCESS] nonebot | Succeeded to load plugin \"nonebot_plugin_orm\"\n02-04 17:49:30 [SUCCESS] nonebot | Succeeded to load plugin \"group_verification\" from \"src.plugins.group_verification\"\n02-04 17:49:30 [SUCCESS] nonebot | Running NoneBot...\n02-04 17:49:30 [SUCCESS] nonebot | Loaded adapters: OneBot V11\n02-04 17:49:30 [INFO] uvicorn | Started server process [89844]\n02-04 17:49:30 [INFO] uvicorn | Waiting for application startup.\n02-04 17:49:30 [INFO] nonebot_plugin_apscheduler | Scheduler Started\n02-04 17:49:30 [ERROR] uvicorn | Traceback (most recent call last):\n File \"/Users/merlin/HajimiBot/.venv/lib/python3.12/site-packages/starlette/routing.py\", line 694, in lifespan\n async with self.lifespan_context(app) as maybe_state:\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/Users/merlin/.local/share/uv/python/cpython-3.12.12-macos-aarch64-none/lib/python3.12/contextlib.py\", line 210, in __aenter__\n return await anext(self.gen)\n ^^^^^^^^^^^^^^^^^^^^^\n File \"/Users/merlin/HajimiBot/.venv/lib/python3.12/site-packages/fastapi/routing.py\", line 153, in merged_lifespan\n async with original_context(app) as maybe_original_state:\n ^^^^^^^^^^^^^^^^^^^^^\n File \"/Users/merlin/.local/share/uv/python/cpython-3.12.12-macos-aarch64-none/lib/python3.12/contextlib.py\", line 210, in __aenter__\n return await anext(self.gen)\n ^^^^^^^^^^^^^^^^^^^^^\n File \"/Users/merlin/HajimiBot/.venv/lib/python3.12/site-packages/nonebot/drivers/fastapi.py\", line 154, in _lifespan_manager\n await self._lifespan.startup()\n File \"/Users/merlin/HajimiBot/.venv/lib/python3.12/site-packages/nonebot/internal/driver/_lifespan.py\", line 66, in startup\n await self._run_lifespan_func(self._startup_funcs)\n File \"/Users/merlin/HajimiBot/.venv/lib/python3.12/site-packages/nonebot/internal/driver/_lifespan.py\", line 55, in _run_lifespan_func\n await cast(ASYNC_LIFESPAN_FUNC, func)()\n File \"/Users/merlin/HajimiBot/.venv/lib/python3.12/site-packages/nonebot_plugin_orm/__init__.py\", line 92, in init_orm\n await greenlet_spawn(migrate.check, alembic_config)\n File \"/Users/merlin/HajimiBot/.venv/lib/python3.12/site-packages/sqlalchemy/util/_concurrency_py3k.py\", line 203, in greenlet_spawn\n result = context.switch(value)\n ^^^^^^^^^^^^^^^^^^^^^\n File \"/Users/merlin/HajimiBot/.venv/lib/python3.12/site-packages/nonebot_plugin_orm/migrate.py\", line 567, in check\n raise AutogenerateDiffsDetected(\nnonebot_plugin_orm.exception.AutogenerateDiffsDetected: 检测到新的升级操作:\n[('add_table',\n Table('gv_blacklist', MetaData(), Column('id', Uuid(), table=\u003cgv_blacklist>, primary_key=True, nullable=False, default=CallableColumnDefault(\u003cfunction uuid4 at 0x10a0c5e40>)), Column('bilibili_uid', BigInteger(), table=\u003cgv_blacklist>), Column('qq_uid', BigInteger(), table=\u003cgv_blacklist>), Column('created_at', DateTime(), table=\u003cgv_blacklist>, nullable=False, server_default=DefaultClause(\u003csqlalchemy.sql.functions.now at 0x10a0aaa80; now>, for_update=False)), Column('updated_at', DateTime(), table=\u003cgv_blacklist>, nullable=False, onupdate=ColumnElementColumnDefault(\u003csqlalchemy.sql.functions.now at 0x10a0aac90; now>), server_default=DefaultClause(\u003csqlalchemy.sql.functions.now at 0x10a0aac00; now>, for_update=False)), schema='gv')),\n ('add_index',\n Index('idx_blacklist_bilibili_uid', Column('bilibili_uid', BigInteger(), table=\u003cgv_blacklist>))),\n ('add_index',\n Index('idx_blacklist_qq_uid', Column('qq_uid', BigInteger(), table=\u003cgv_blacklist>))),\n ('add_table',\n Table('gv_user', MetaData(), Column('id', Uuid(), table=\u003cgv_user>, primary_key=True, nullable=False, default=CallableColumnDefault(\u003cfunction uuid4 at 0x10a0c6520>)), Column('bilibili_uid', BigInteger(), table=\u003cgv_user>, nullable=False), Column('qq_uid', BigInteger(), table=\u003cgv_user>, nullable=False), Column('created_at', DateTime(), table=\u003cgv_user>, nullable=False, server_default=DefaultClause(\u003csqlalchemy.sql.functions.now at 0x10a0aba40; now>, for_update=False)), Column('updated_at', DateTime(), table=\u003cgv_user>, nullable=False, onupdate=ColumnElementColumnDefault(\u003csqlalchemy.sql.functions.now at 0x10a0abbf0; now>), server_default=DefaultClause(\u003csqlalchemy.sql.functions.now at 0x10a0abad0; now>, for_update=False)), schema='gv')),\n ('add_index',\n Index('idx_user_bilibili_uid', Column('bilibili_uid', BigInteger(), table=\u003cgv_user>, nullable=False))),\n ('add_index',\n Index('idx_user_qq_uid', Column('qq_uid', BigInteger(), table=\u003cgv_user>, nullable=False)))]\n\n02-04 17:49:30 [ERROR] uvicorn | Application startup failed. Exiting.\n(flashbot) merlin@merlins-MacBook-Pro ~/HajimiBot dev ± nb upgrade \n使用 Python: /Users/merlin/HajimiBot/.venv/bin/python\nUsage: nb [OPTIONS] COMMAND [ARGS]...\nTry 'nb -h' for help.\n\nError: No such command 'upgrade'.\n(flashbot) ✘ merlin@merlins-MacBook-Pro ~/HajimiBot dev ± nb orm upgrade \n使用 Python: /Users/merlin/HajimiBot/.venv/bin/python\n02-04 17:49:43 [SUCCESS] nonebot | NoneBot is initializing...\n02-04 17:49:43 [INFO] nonebot | Current Env: prod\n02-04 17:49:44 [SUCCESS] nonebot | Succeeded to load plugin \"nonebot_plugin_localstore\"\n02-04 17:49:44 [SUCCESS] nonebot | Succeeded to load plugin \"group_verification\" from \"src.plugins.group_verification\"\n02-04 17:49:44 [SUCCESS] nonebot | Succeeded to load plugin \"nonebot_plugin_orm\"\n02-04 17:49:44 [SUCCESS] nonebot | Succeeded to load plugin \"nonebot_plugin_apscheduler\"\n(flashbot) merlin@merlins-MacBook-Pro ~/HajimiBot dev ± nb orm check \n使用 Python: /Users/merlin/HajimiBot/.venv/bin/python\n02-04 17:49:50 [SUCCESS] nonebot | NoneBot is initializing...\n02-04 17:49:50 [INFO] nonebot | Current Env: prod\n02-04 17:49:51 [SUCCESS] nonebot | Succeeded to load plugin \"nonebot_plugin_localstore\"\n02-04 17:49:51 [SUCCESS] nonebot | Succeeded to load plugin \"nonebot_plugin_orm\"\n02-04 17:49:51 [SUCCESS] nonebot | Succeeded to load plugin \"nonebot_plugin_apscheduler\"\n02-04 17:49:51 [SUCCESS] nonebot | Succeeded to load plugin \"group_verification\" from \"src.plugins.group_verification\"\nError: 检测到新的升级操作:\n[('add_table',\n Table('gv_blacklist', MetaData(), Column('id', Uuid(), table=\u003cgv_blacklist>, primary_key=True, nullable=False, default=CallableColumnDefault(\u003cfunction uuid4 at 0x10a2f1f80>)), Column('bilibili_uid', BigInteger(), table=\u003cgv_blacklist>), Column('qq_uid', BigInteger(), table=\u003cgv_blacklist>), Column('created_at', DateTime(), table=\u003cgv_blacklist>, nullable=False, server_default=DefaultClause(\u003csqlalchemy.sql.functions.now at 0x10a2cb3e0; now>, for_update=False)), Column('updated_at', DateTime(), table=\u003cgv_blacklist>, nullable=False, onupdate=ColumnElementColumnDefault(\u003csqlalchemy.sql.functions.now at 0x10a2cb5f0; now>), server_default=DefaultClause(\u003csqlalchemy.sql.functions.now at 0x10a2cb560; now>, for_update=False)), schema='gv')),\n ('add_index',\n Index('idx_blacklist_bilibili_uid', Column('bilibili_uid', BigInteger(), table=\u003cgv_blacklist>))),\n ('add_index',\n Index('idx_blacklist_qq_uid', Column('qq_uid', BigInteger(), table=\u003cgv_blacklist>))),\n ('add_table',\n Table('gv_user', MetaData(), Column('id', Uuid(), table=\u003cgv_user>, primary_key=True, nullable=False, default=CallableColumnDefault(\u003cfunction uuid4 at 0x10a2f2660>)), Column('bilibili_uid', BigInteger(), table=\u003cgv_user>, nullable=False), Column('qq_uid', BigInteger(), table=\u003cgv_user>, nullable=False), Column('created_at', DateTime(), table=\u003cgv_user>, nullable=False, server_default=DefaultClause(\u003csqlalchemy.sql.functions.now at 0x10ab5c350; now>, for_update=False)), Column('updated_at', DateTime(), table=\u003cgv_user>, nullable=False, onupdate=ColumnElementColumnDefault(\u003csqlalchemy.sql.functions.now at 0x10ab5c500; now>), server_default=DefaultClause(\u003csqlalchemy.sql.functions.now at 0x10ab5c4a0; now>, for_update=False)), schema='gv')),\n ('add_index',\n Index('idx_user_bilibili_uid', Column('bilibili_uid', BigInteger(), table=\u003cgv_user>, nullable=False))),\n ('add_index',\n Index('idx_user_qq_uid', Column('qq_uid', BigInteger(), table=\u003cgv_user>, nullable=False)))]\n```\n\u003c/details> \n\n","author":{"url":"https://github.com/MerlinCN","@type":"Person","name":"MerlinCN"},"datePublished":"2026-02-04T09:55:58Z","url":"https://github.com/nonebot/plugin-orm/issues/35"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:67662ac1-05f8-b8a0-f8ab-3a2bfde0cb1e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BF26:1A4796:575121:7A9006:6B047598 |
| html-safe-nonce | 4a4c1073fd9874e4197d350e5f578a2c7cac8f9763bc1e44485ad4380ccf9224 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjI2OjFBNDc5Njo1NzUxMjE6N0E5MDA2OjZCMDQ3NTk4IiwidmlzaXRvcl9pZCI6IjcyNzg1MjE5MzY5MDM0MzU2NzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5625c65682e49747739e559786c7c90f38f6153832c91b9107766cab53691565 |
| hovercard-subject-tag | issue:3895667284 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nonebot/plugin-orm/35/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1f5e5e0886248f98846bcf09e845c01743213bbe0c6b95c005dcd87675c37ed3/nonebot/plugin-orm/issues/35 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1f5e5e0886248f98846bcf09e845c01743213bbe0c6b95c005dcd87675c37ed3/nonebot/plugin-orm/issues/35 |
| og:image:alt | 默认(public)下的 model 其他 schema(这里我设置了为 gv) 生成的迁移文件正常 数据库结构也正常 但是再次运行 bot(等效 nb orm check)会一直报错 目前临时解决办法是都放到 public 里面 日志 (flashbot) merlin@merlins-MacBook-Pro ~/HajimiBot dev ± nb orm revisio... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MerlinCN |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9c099f1b85def81ca352464c276510dfef32deaf3c305404e65b8d270284a58b |
| turbo-cache-control | no-preview |
| go-import | github.com/nonebot/plugin-orm git https://github.com/nonebot/plugin-orm.git |
| octolytics-dimension-user_id | 63496654 |
| octolytics-dimension-user_login | nonebot |
| octolytics-dimension-repository_id | 624721795 |
| octolytics-dimension-repository_nwo | nonebot/plugin-orm |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 624721795 |
| octolytics-dimension-repository_network_root_nwo | nonebot/plugin-orm |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cf73f57448d52b3a7b619195e182b33d3b3454ca |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width