Error ketika build-all atau insert-sql : check the manual that corresponds to your MySQL server version for the right syntax to use near 'Type=InnoDB' at line 15
Solusi 1 : Tetap Menggunakan sfPropelPlugin
Edit baris 156 dari file :
/usr/share/php/symfony/symfony14/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/builder/sql/mysql/MysqlDDLBuilder.php
dari :
$script .= "Type=$mysqlTableType";
menjadi :
$script .= "Engine=$mysqlTableType";
Solusi 2 : Mengganti sfPropelPlugin dengan sfPropelORMPlugin
symfony 1.4 secara default menggunakan sfPropelPlugin [1] (Propel 1.4), versi yang dibundle pada symfony 1.3 dan symfony 1.4, Propel 1.4 tidak kompatibel dengan MySQL terbaru, sebagai gantinya sfPropelPlugin digantikan dengan sfPropelORMPlugin [2] yang sudah menggunakan Propel versi 1.6 [3].
Jadi untuk mengatasi error :
check the manual that corresponds to your MySQL server version for the right syntax to use near 'Type=InnoDB' at line 15
Gantilah sfPropelPlugin dengan sfPropelORMPlugin, caranya bagaimana ? silahkan baca dokumentasi di [2].
Hanya satu hal yang perlu menjadi catatan, setelah mengganti sfPropelPlugin dengan sfPropelORMPlugin, pada bagian ; behaviors, tambahkanlah baris berikut :
; behaviors
propel.behavior.default = symfony,symfony_i18n
propel.behavior.symfony.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorSymfony
propel.behavior.symfony_i18n.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorI18n
propel.behavior.symfony_i18n_translation.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorI18nTranslation
propel.behavior.symfony_behaviors.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorSymfonyBehaviors
propel.behavior.symfony_timestampable.class = plugins.sfPropelORMPlugin.lib.behavior.SfPropelBehaviorTimestampable
Pada dokumentasi instalasi sfPropelORMPlugin, tidak ditulis untuk tetap menuliskan baris :
propel.behavior.default = symfony,symfony_i18n
Tulislah baris diatas, kalau tidak anda akan mendapatkan error seperti berikut :
(JobeetPropel) ./symfony propel:build-form
>> propel generating form classes
PHP Warning: call_user_func() expects parameter 1 to be a valid callback, class 'JobeetJobPeer' does not have a method 'getUniqueColumnNames' in /usr/share/php/symfony/symfony14/lib/plugins/sfPropelORMPlugin/lib/generator/sfPropelFormGenerator.class.php on line 564
Referensi
sfPropelPlugin, http://www.symfony-project.org/plugins/sfPropelPlugin
sfPropelORMPlugin, http://www.symfony-project.org/plugins/sfPropelORMPlugin
What’s new in Propel 1.6?, http://propelorm.org/documentation/whats-new.html