有一張表customer_account( postgres) 是從 YII2 遷移過來的。DDL:CREATE TABLE public.test_table ( id INTEGER PRIMARY KEY NOT NULL DEFAULT nextval('test_table_id_seq'::regclass), data JSONB);在 Go 項目中,我嘗試從這張表中獲取價值。type TableGo struct { Id int Data string `gorm:"type:jsonb"`} table := TableGo{} db.Where("id = ?", 75).Find(&table) println(table.Data)但是還有(pq: relation "table_gos" does not exist)我如何鏈接沒有哪個表的結構db.AutoMigrate(&TableGo{})?
- 2 回答
- 0 關注
- 259 瀏覽
添加回答
舉報
0/150
提交
取消