Skip to content

Commit

Permalink
修复pg数据库迁移脚本执行失败的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ssttkkl committed Nov 26, 2023
1 parent c407ce7 commit a9c18cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nonebot-plugin-access-control"
version = "1.1.4"
version = "1.1.5"
description = ""
authors = ["ssttkkl <[email protected]>"]
license = "MIT"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ async def data_migrate(conn: AsyncConnection):
# nonebot_plugin_access_control_rate_limit_rule
result = await ds_sess.stream(
sa.text(
"SELECT id, subject, service, time_span, `limit`, overwrite "
'SELECT id, subject, service, time_span, "limit", overwrite '
"FROM nonebot_plugin_access_control_rate_limit_rule;"
)
)
async for row in result:
id, subject, service, time_span, limit, overwrite = row
await conn.execute(
sa.text(
"INSERT INTO accctrl_rate_limit_rule (id, subject, service, time_span, `limit`, overwrite) "
'INSERT INTO accctrl_rate_limit_rule (id, subject, service, time_span, "limit", overwrite) '
"VALUES (:id, :subject, :service, :time_span, :limit, :overwrite);"
),
[
Expand All @@ -106,15 +106,15 @@ async def data_migrate(conn: AsyncConnection):
# nonebot_plugin_access_control_rate_limit_token
result = await ds_sess.stream(
sa.text(
"SELECT id, rule_id, `user`, acquire_time, expire_time "
'SELECT id, rule_id, "user", acquire_time, expire_time '
"FROM nonebot_plugin_access_control_rate_limit_token;"
)
)
async for row in result:
id, rule_id, user, acquire_time, expire_time = row
await conn.execute(
sa.text(
"INSERT INTO accctrl_rate_limit_rule (id, rule_id, `user`, acquire_time, expire_time) "
'INSERT INTO accctrl_rate_limit_rule (id, rule_id, "user", acquire_time, expire_time) '
"VALUES (:id, :rule_id, :user, :acquire_time, :expire_time);"
),
[
Expand Down

0 comments on commit a9c18cf

Please sign in to comment.