僕が、Railsの中で高く評価していて、お気に入りの機能がMigrationです。なぜならば、Migrationにスキーマ情報を管理させることで、スキーマ情報を開発者間や、テスト時において、統一させることができるし、スキーマのロールバックもできるようになるからです。 システムで良い物ができたとしても、リリースでミスったら結局のところ、ダメなシステムとみなされる可能性があります。以外と権限設定関連、シェル実行時のパスなどでミスが多く見受けられます。また、SQLのスキーマについても同様でミスが出やすいように思います。なので、Migrationがあればリリース時でも安心です。※Capistrano使うとMigrationしてくれるのかな?? 実行は、このようにする。rake db:migrate 特定のバージョン番号にしたいときは、このようにする。rake db:migrate VERSION=
マイグレーションを使うとデータベース固有のデータ型に依存しない表現でスキーマの定義ができる。MySQLであれば、実際にはこんな定義になる。 抽象表記 Ruby MySQL :primary_key Fixnum int(11) DEFAULT NULL auto_increment PRIMARY KEY :string String varchar(255) :text String text :integer Fixnum int(11) :float Float float :datetime Time datetime :timestamp Time datetime :time Time datetime :date Date date :binary String blob :boolean Object tinyint(1) MySQLではtimestamp型のカラムは、形式
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く