日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

golang使用migrate遷移pg數據庫表報錯處理

作者:大魚天 更新時間: 2024-07-15 編程語言
migrate -database postgres://greenlight:xxxxxx@localhost:55433/greenlight?sslmode=disable ?-path ./migrations/ ?up

報錯信息:

error: pq: permission denied for schema public in line 0: CREATE TABLE IF NOT EXISTS "public"."schema_migrations" (version bigint not null primary key, dirty boolean not null)

處理辦法

使用postgres用戶登錄數據庫,執行下面命令:

grant all privileges on database greenlight to greenlight

alter database greenlight owner to greenlight

然后重新執行上面migrate命令,成功執行:

1/u create_movies_table (19.429ms)
2/u add_movies_check_constraints (30.8229ms)

原文鏈接:https://blog.csdn.net/kfeng632/article/details/140371073

  • 上一篇:沒有了
  • 下一篇:沒有了
欄目分類
最近更新