チェックWizardby:それはあなたのデータベーススキーマへの変更を表現するために(SQL DDLにやや近い)特殊な言語を提供しています。
migration "Blog" revision => 1:
type-aliases:
type-alias N type => String, length => 200, nullable => false, default => ""
defaults:
default-primary-key ID type => Int32, nullable => false, identity => true
version 20090226100407:
add table Author: /* Primary Key is added automatically */
FirstName type => N /* “add” can be omitted */
LastName type => N
EmailAddress type => N, unique => true /* "unique => true" will create UQ_EmailAddress index */
Login type => N, unique => true
Password type => Binary, length => 64, nullable => true
index UQ_LoginEmailAddress unique => true, columns => [[Login, asc], EmailAddress]
add table Tag:
Name type => N
add table Blog:
Name type => N
Description type => String, nullable => false
add table BlogPost:
Title type => N
Slug type => N
BlogID references => Blog /* Column type is inferred automatically */
AuthorID:
reference pk-table => Author
これらversion
ブロックは基本的には、データベーススキーマに適用したい変更されます。
Wizardbyをビルドプロセスとアプリケーションに統合することもできます。起動時には、データベースを最新のバージョンにアップグレードできます。したがって、アプリケーションは常に最新のスキーマバージョンで動作します。
セットアッププロセスに統合することもできます。WizardbyはSQLスクリプトを生成してデータベーススキーマを変更することができ、セットアッププロセスの一部として実行できます。
これはスクリプトの代わりにコードの投票ですか? SMOなどを使ってこのような仕組みを書くことができて面白そうです。 – grapkulec