-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created a migration file to change the class name field length to 255…
…. Added a warning in the console if the user inputs a description longer than 255 characters.
- Loading branch information
1 parent
35c5917
commit 8a9cc5d
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
class IncreaseClassNameLength extends CakeMigration { | ||
|
||
/** | ||
* Migration description | ||
* | ||
* @var string | ||
* @access public | ||
*/ | ||
public $description = 'Increase the maximum length of class names.'; | ||
|
||
/** | ||
* Actions to be performed | ||
* | ||
* @var array $migration | ||
* @access public | ||
*/ | ||
public $migration = array( | ||
'up' => array( | ||
'alter_field' => array( | ||
'schema_migrations' => array( | ||
'class' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 255, 'name' => 'class') | ||
) | ||
) | ||
), | ||
'down' => array( | ||
'alter_field' => array( | ||
'schema_migrations' => array( | ||
'class' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 33, 'name' => 'class') | ||
) | ||
) | ||
) | ||
); | ||
|
||
/** | ||
* Before migration callback | ||
* | ||
* @param string $direction, up or down direction of migration process | ||
* @return boolean Should process continue | ||
* @access public | ||
*/ | ||
public function before($direction) { | ||
return true; | ||
} | ||
|
||
/** | ||
* After migration callback | ||
* | ||
* @param string $direction, up or down direction of migration process | ||
* @return boolean Should process continue | ||
* @access public | ||
*/ | ||
public function after($direction) { | ||
return true; | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters