並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 12 件 / 12件

新着順 人気順

migrationsの検索結果1 - 12 件 / 12件

  • CakePHP2系でマイグレーションを利用する方法

    マイグレーションを使わないで、データベースのスキーマ構成を変更したりすると、特に複数人で開発しているような場合にこんなことが起こったりします。 自分の開発マシンとテストサーバ等でスキーマ構成が違っているさらには他人の開発マシンともスキーマ構成が異なっているしかもどっちがあっているか分からない例えば、みんなが色々変更しているせいで、カラムの順番が入れ子になってたりする本番サーバに反映しようとした時に、どの順番にスキーマ変更を行ったらよいか分からない。ソースコードのリリースバージョンと紐付くデータベースの状態がよく分からない。こういう本質的でないことに時間を使っては勿体無いので、データベースの構成管理にはマイグレーション機能を使うのが定石です。Railsなんかだと当たり前なのですが、今回はCakePHP2系でマイグレーションを利用する方法を紹介します。 CakeDC Migrationの導入C

      CakePHP2系でマイグレーションを利用する方法
    • Ruby on Rails Guides: Migrations

      Migrations are a feature of Active Record that allows you to evolve your database schema over time. Rather than write schema modifications in pure SQL, migrations allow you to use a Ruby DSL to describe changes to your tables. After reading this guide, you will know: The generators you can use to create them. The methods Active Record provides to manipulate your database. The rails commands that m

        Ruby on Rails Guides: Migrations
      • Migrationsプラグインの実践的運用 - 24時間CakePHP

        CakePHP Advent Calendar 2011 CakePHP Advent Calendar 2011 : ATND 20日目の記事です。 19日目:akiyanさんCakePHPの「OrderdBehavior」と「TreeBehavior」はマジで使うべき : akiyan.com イントロダクション CakeDCが提供しているMigrationsプラグインは、データベースのインクリメンタルなバージョン管理を行うプラグインで、githubでホストされています。 RoR(Ruby on Rails)のMigrationsをリスペクトしているのは間違いなさそう(どこにも書いてないけど)ですが、中身はそれなりに違います。 Migrationsプラグインの詳細な説明は CakePHP Migrations plugin: easily version and deploy whol

          Migrationsプラグインの実践的運用 - 24時間CakePHP
        • CakePHPにMigrations Pluginを導入する | mawatari.jp

          CakePHPにMigrations Pluginを導入したときのメモ。 参考リンク:CakeDC / migrations – GitHub Migrations Pluginの導入 以下は、CakePHPで制作するアプリケーションをGitで管理している場合の手順です。Gitで管理していない場合は、Pluginディレクトリに直接Migrationsのファイル群を設置してください。

            CakePHPにMigrations Pluginを導入する | mawatari.jp
          • Doctrineのmigration機能でデータベーススキーマの差分管理 - しんふぉにゃん

            DoctrineにはRuby on Rails由来のmigration機能があります。 この機能を今まで使っていなかったので、ちょっと調べてみました。 なお、参考ドキュメントは以下ですが、このドキュメントを読むだけでは細かい挙動を把握できませんでした。 symfony 1.x legacy website http://www.doctrine-project.org/projects/orm/1.2/docs/manual/migrations/ja#migrations コマンド php symfony doctrine:generate-migration php symfony doctrine:generate-migrations-db php symfony doctrine:generate-migrations-models php symfony doctrine:ge

              Doctrineのmigration機能でデータベーススキーマの差分管理 - しんふぉにゃん
            • migrationで複数カラムのindexを生成する時の注意事項 - マオの徒然日記

              Ruby on Railsではmigrationファイルに add_index テーブル名, :カラム名, :unique => true とすることで簡単にテーブルにユニークなindexを生成することが出来ます。 そして、indexに複数のカラムを設定する際は add_index テーブル名, [:カラム名1, :カラム名2, ・・・], :unique => true のようにすることで実現できます。 なので、意気揚々とindexを作成していたら以下のようなエラー。 Index name 'xxxxxxxxxxxxxxxxxxx' on table 'テーブル名' is too long; the limit is 64 characters 何も考えず複数カラムでindexを生成していたら、その名前が長くなりすぎて、エラーとのこと。 64文字以内にしなさいね、ということらしいです。

                migrationで複数カラムのindexを生成する時の注意事項 - マオの徒然日記
              • yuum3のお仕事日記 - migrationファイルの調整、テーブル作成

                Model で作成された各テーブル用migrationファイルに NOT NULL制約や index を追加します。 制約やindexの付け方にはいろいろな流儀があると思いますが、今回は以下のような考え方で付けます。 NOT NULL制約は外部キーのようにそこがnullになってしまうと明らかにデータ構造がおかしくなってしまうカラム また、テーブルの核になるデータでそのカラムがnullのデータというのはありえないカラム index は外部キー等でjoint等で絶対用いられるカラム どのようなルールにするかは、作成するDBの性格や文化があるので、これが正解だというのはありません。ただし、一つのプロジェクトの中では統一された考え方や一貫性があることは重要だと思います。 例: class CreateRequests < ActiveRecord::Migration def self.up cr

                  yuum3のお仕事日記 - migrationファイルの調整、テーブル作成
                • [phpmig]PHPでマイグレーション - Qiita

                  簡単に実行できる、ベンダーやフレームワークへの依存の少ないPHPのマイグレーションツール (READMEから意訳 ここに書いてあるメモは全部READMEに書いてある 後々確実にお世話になるので今のうちに軽く触れてめもめも 参考 PHPで使えるDBマイグレーションツール phpmig - エンジニアきまぐれTips https://github.com/davedevelopment/phpmig インストールから初期化まで PEARかcomposerを利用してphpmigをインストール composerでのインストールがベストらしい composerでインストール プロジェクト用にローカライズされたphpmigが利用できるようになる(直訳 $ cd /path/to/project $ echo <<EOT > composer.json { "require": { "php": ">=

                    [phpmig]PHPでマイグレーション - Qiita
                  • Loading...

                    • the { buckblogs :here }: Getting Started With ActiveRecord Migrations

                      Getting Started With ActiveRecord Migrations Posted by Jamis on September 26, 2005 @ 08:13 PM Migrations have got to be one of the coolest aspects of ActiveRecord. They allow you to incrementally evolve your database schema, as you build your application. Bit by bit, you define the tables as you need them, add or remove columns, insert data, and so forth, preserving and migrating your data as you

                      • Wiki | CodeIgniter

                        Database Migrations in CodeIgniter Migrations is a simple utility inspired by its Ruby on Rails counterpart that makes working with database changes a lot easier to development teams. The concept is really simple: abstract each change to your database schema to a “migration” class in a way that other team members can apply (and undo) each change easily. Common usage * Each individual in a team is

                        • leave your migrations in your Rails engines

                          If you are using Rails engines to break up a single app into modular pieces, migrations (as they are currently implemented in Rails 3.2.13) become clumsy. There are three options for migrations within an engine (spoiler: #3 is the best): 1) You can use the your_engine_name:install:migrations rake task, which copies the migrations out of the engine and into the wrapping Rails app where they can be

                            leave your migrations in your Rails engines
                          1