照着官网的示例,发现可以从数据库中生成migrations,但是却查不到,debug源码发现是vendor\phalcon\migrations\src\Version\ItemCollection.php中的self::TYPE_INCREMENTAL,self::TYPE_TIMESTAMPED和self::$type比较引起的,配置文件config.php中migrationsTsBased中的配置bug,官网示例配置为true,按理说应当为时间戳,但是生成的migrations却是version版本的.
‘application’ => [
‘logInDb’ => true,
‘no-auto-increment’ => true,
‘skip-ref-schema’ => true,
‘skip-foreign-checks’ => true,
‘migrationsDir’ => ‘db/migrations’,
‘migrationsTsBased’ => true, // true – Use TIMESTAMP as version name, false – use versions
‘exportDataFromTables’ => [
// Tables names
// Attention! It will export data every new migration
],
],
将上述配置改为false,就可以了。
留下评论