0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

EntityFrameworkCoreでDDLファイルを出力する

Posted at

#目的
ASP.NET Core(.NET Core)でコードファーストでデータベースを作成する。
この際、実際データベースに発行しているDDL(SQL)をファイルに出力する方法を記す。

#前提条件
Microsoft.EntityFrameworkCore.Tools を導入済である

#方法
1.テーブルセットファイルを作成する
PM> Add-Migration Init Build started... Build succeeded. To undo this action, use Remove-Migration.
https://docs.microsoft.com/ja-jp/ef/core/cli/powershell#add-migration

2.SQLスクリプト(DDL)を作成する
PM> Script-Migration 0 Build started... Build succeeded.

##注意
本来マイグレーションを意識したコマンドである。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?