LoginSignup
3
3

More than 5 years have passed since last update.

既存のデータを残しつつFuelPHPでMigrationする方法

Posted at

1. 必要なデータのバックアップをとる

$ mysqldump -u root -p -h localhost データベース名 テーブル名 (複数テーブルの場合は半角スペースで区切る) > ~/tmp/backup_`date +%Y%m%d-%H%M%S`.sql

2. データベース削除して新規作成する

mysql> drop database データベース名
mysql> create database データベース名

3. migrationを実行する

$ FUEL_ENV=development oil refine migrate

4. バックアップしていたデータを復元する

$ mysql -h localhost -u root -p --default-character-set=utf8 データベース名 < ~/tmp/backup_20140902-173636.sql
3
3
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
3
3