-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from krolow/develop
Merge develop changes
- Loading branch information
Showing
2 changed files
with
92 additions
and
1 deletion.
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,90 @@ | ||
<?php | ||
class CreateAttachmentsTable extends CakeMigration { | ||
|
||
/** | ||
* Migration description | ||
* | ||
* @var string | ||
* @access public | ||
*/ | ||
public $description = ''; | ||
|
||
/** | ||
* Actions to be performed | ||
* | ||
* @var array $migration | ||
* @access public | ||
*/ | ||
public $migration = array( | ||
'up' => array( | ||
'create_table' => array( | ||
'attachments' => array( | ||
'id' => array( | ||
'type' => 'integer', | ||
'null' => false, | ||
'default' => null, | ||
'key' => 'primary' | ||
), | ||
'filename' => array( | ||
'type' => 'string', | ||
'null' => false, | ||
'length' => 150 | ||
), | ||
'model' => array( | ||
'type' => 'string', | ||
'null' => false, | ||
'length' => 150 | ||
), | ||
'foreign_key' => array( | ||
'type' => 'integer', | ||
'null' => false | ||
), | ||
'type' => array( | ||
'type' => 'string', | ||
'null' => false, | ||
'length' => 100 | ||
), | ||
'indexes' => array( | ||
'PRIMARY' => array( | ||
'column' => 'id', | ||
'unique' => 1 | ||
), | ||
), | ||
'tableParameters' => array( | ||
'charset' => 'latin1', | ||
'collate' => 'latin1_swedish_ci', | ||
'engine' => 'InnoDB' | ||
), | ||
), | ||
), | ||
), | ||
'down' => array( | ||
'drop_table' => array( | ||
'attachments' | ||
), | ||
), | ||
); | ||
|
||
|
||
/** | ||
* 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