i18n.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  4. * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
  5. *
  6. * Licensed under The MIT License
  7. * Redistributions of files must retain the above copyright notice.
  8. *
  9. * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
  10. * @link http://cakephp.org CakePHP(tm) Project
  11. * @package app.Config.Schema
  12. * @since CakePHP(tm) v 0.2.9
  13. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  14. */
  15. /**
  16. *
  17. * Using the Schema command line utility
  18. *
  19. * Use it to configure database for i18n
  20. *
  21. * cake schema run create i18n
  22. */
  23. // @codingStandardsIgnoreStart
  24. class I18nSchema extends CakeSchema {
  25. // @codingStandardsIgnoreEnd
  26. public $name = 'i18n';
  27. public function before($event = array()) {
  28. return true;
  29. }
  30. public function after($event = array()) {
  31. }
  32. public $i18n = array(
  33. 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
  34. 'locale' => array('type' => 'string', 'null' => false, 'length' => 6, 'key' => 'index'),
  35. 'model' => array('type' => 'string', 'null' => false, 'key' => 'index'),
  36. 'foreign_key' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
  37. 'field' => array('type' => 'string', 'null' => false, 'key' => 'index'),
  38. 'content' => array('type' => 'text', 'null' => true, 'default' => null),
  39. '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))
  40. );
  41. }