2022-11-03から1日間の記事一覧

【Go】entでスキーマファイルを出力する

TL;DR entには全体のスキーマを出力する機能はない 空のデータベースに対してマイグレーションDiffを作成して.sqlファイルに出力する ctx := context.Background() db, err := ent.Open("mysql", "docker:docker@tcp(localhost:3306)/em?parseTime=True") if…