2012-08-29 97 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/';