とあるセクシーなデータ分析官

を目指す渋谷で働くソーシャルゲーム分析者の卵

追記 テーブル情報だけバックアップとりたい場合

mysqldump hoge -d > hoge.sql -u root


インポート
$ mysql xxxdb < xxxdb.sql -u root

参考文献:http://www.avant-tokyo.com/linux/mysql_export_import.html


2.
「DATETIMEとTIMESTAMPに関するschema.ymlの修正」
Execution of target "om-template" failed for the following reason: /usr/share/pear/symfony/vendor/propel-generator/build-prop el.xml:470:1: Unable to parse default value as date/time value: 'null'
[phingcall] /usr/share/pear/symfony/vendor/propel-generator/build-propel.xml:470:1: Unable to parse default value as date/tim e value: 'null'

参考文献1:http://wiki.type33.com/symfony/propel

SQLにてDATETIMEとして設定してたものがpropel-build-schemaにてTIMESTAMP型に置き換わっていた。
schema.ymlにて、このタイプをDATETIMEに修正した。


modified_info:
type: TIMESTAMP → DATETIME
required: true
default:


3.
「DATETIMEとTIMESTAMPに関するschema.ymlの修正2」
[Exception in XML parsing]
exception 'EngineException' with message 'Error setting up column 'modified_info': Cannot map unknown Propel type 'NULL' to native database type.'
in /usr/share/pear/symfony/vendor/propel-generator/classes/propel/engine/database/model/Column.php:190
Stack trace:

参考文献1:http://d.hatena.ne.jp/fashi2/searchdiary?word=*[php]
参考文献2:http://wiki.type33.com/symfony/propel

DATETIMEと記載したらNULLはダメだよって言われたので
dafault: 0000-00-00 00:00:00とした


4.
「DATETIMEとTIMESTAMPに関するschema.ymlの修正3」
[Exception in XML parsing]
exception 'EngineException' with message 'Error setting up column 'modified_info': Cannot map unknown Propel type 'DATETIME' to native database type.'
in /usr/share/pear/symfony/vendor/propel-generator/classes/propel/engine/database/model/Column.php:190

そんなタイプは無い!とか言われるので振り出しに戻る。
仕方がないので type: TIMESTAMP に戻し
default: の項目を削除したらすんなりとできた。不思議不思議。
とりあえずdefault削除に関してはエラーが出たら考えることに。


modified_info:
type: DATETIME → TIMESTAMP
required: true
default: → 行ごと削除!