| 16591 |
anikendra |
1 |
<?php
|
|
|
2 |
/**
|
|
|
3 |
* This is i18n Schema file
|
|
|
4 |
*
|
|
|
5 |
* Use it to configure database for i18n
|
|
|
6 |
*
|
|
|
7 |
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
|
|
8 |
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
|
9 |
*
|
|
|
10 |
* Licensed under The MIT License
|
|
|
11 |
* For full copyright and license information, please see the LICENSE.txt
|
|
|
12 |
* Redistributions of files must retain the above copyright notice.
|
|
|
13 |
*
|
|
|
14 |
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
|
15 |
* @link http://cakephp.org CakePHP(tm) Project
|
|
|
16 |
* @package app.Config.Schema
|
|
|
17 |
* @since CakePHP(tm) v 0.2.9
|
|
|
18 |
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
|
|
19 |
*/
|
|
|
20 |
|
|
|
21 |
/**
|
|
|
22 |
* Using the Schema command line utility
|
|
|
23 |
*
|
|
|
24 |
* Use it to configure database for i18n
|
|
|
25 |
*
|
|
|
26 |
* cake schema run create i18n
|
|
|
27 |
*/
|
|
|
28 |
class I18nSchema extends CakeSchema {
|
|
|
29 |
|
|
|
30 |
public $name = 'i18n';
|
|
|
31 |
|
|
|
32 |
/**
|
|
|
33 |
* Before callback.
|
|
|
34 |
*
|
|
|
35 |
* @param array $event Schema object properties
|
|
|
36 |
* @return bool Should process continue
|
|
|
37 |
*/
|
|
|
38 |
public function before($event = array()) {
|
|
|
39 |
return true;
|
|
|
40 |
}
|
|
|
41 |
|
|
|
42 |
/**
|
|
|
43 |
* After callback.
|
|
|
44 |
*
|
|
|
45 |
* @param array $event Schema object properties
|
|
|
46 |
* @return void
|
|
|
47 |
*/
|
|
|
48 |
public function after($event = array()) {
|
|
|
49 |
}
|
|
|
50 |
|
|
|
51 |
public $i18n = array(
|
|
|
52 |
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
|
|
|
53 |
'locale' => array('type' => 'string', 'null' => false, 'length' => 6, 'key' => 'index'),
|
|
|
54 |
'model' => array('type' => 'string', 'null' => false, 'key' => 'index'),
|
|
|
55 |
'foreign_key' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
|
|
|
56 |
'field' => array('type' => 'string', 'null' => false, 'key' => 'index'),
|
|
|
57 |
'content' => array('type' => 'text', 'null' => true, 'default' => null),
|
|
|
58 |
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'locale' => array('column' => 'locale', 'unique' => 0), 'model' => array('column' => 'model', 'unique' => 0), 'row_id' => array('column' => 'foreign_key', 'unique' => 0), 'field' => array('column' => 'field', 'unique' => 0))
|
|
|
59 |
);
|
|
|
60 |
|
|
|
61 |
}
|