0

我有一个简单的问题。我想开始使用 CodeIgniter 迁移。但是我的配置文件夹中没有 migrations.php 文件,就像文档中所说的那样。另外,我是否需要在应用程序文件夹级别手动创建迁移文件夹?

4

1 回答 1

1

奇怪的是,您的application/config/migration.php文件未包含在下载中,但是...即使配置文件不存在,迁移库仍将(或应该)在您的 CodeIgnitersystem/libraries文件夹中。

migration.php作为默认配置文件的一部分,有三个配置变量:

/*
|--------------------------------------------------------------------------
| Enable/Disable Migrations
|--------------------------------------------------------------------------
|
| Migrations are disabled by default but should be enabled 
| whenever you intend to do a schema migration.
|
*/
$config['migration_enabled'] = FALSE;


/*
|--------------------------------------------------------------------------
| Migrations version
|--------------------------------------------------------------------------
|
| This is used to set migration version that the file system should be on.
| If you run $this->migration->latest() this is the version that schema will
| be upgraded / downgraded to.
|
*/
$config['migration_version'] = 0;


/*
|--------------------------------------------------------------------------
| Migrations Path
|--------------------------------------------------------------------------
|
| Path to your migrations folder.
| Typically, it will be within your application path.
| Also, writing permission is required within the migrations path.
|
*/
$config['migration_path'] = APPPATH . 'migrations/';
于 2012-08-29T20:57:34.860 回答