2012-08-29 56 views
0

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

+0

我甚至下载最新版本2.1.2,但它不存在。 – sehummel

+0

这是文档:http://codeigniter.com/user_guide/libraries/migration.html – sehummel

+0

奇怪的是,该文件位于GitHub稳定分支上,但不在下载中。 – sehummel

回答

1

奇怪的是,您的application/config/migration.php文件未包含在下载中,但是...即使配置文件不存在,迁移库将(或应该)仍在您的CodeIgniter system/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/';