Skip to content

Commit

Permalink
adding update for comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed May 21, 2012
1 parent 5c502f2 commit 0b8d46e
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Core/Comments/Config/Schema/schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ public function after($event = array()) {
public $infinitas_comments = array(
'id' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 36, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'class' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 128, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'foreign_id' => array('type' => 'integer', 'null' => false, 'default' => NULL),
'user_id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 8),
'foreign_id' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 36, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'user_id' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 36, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'email' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 100, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'comment' => array('type' => 'text', 'null' => false, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'active' => array('type' => 'boolean', 'null' => false, 'default' => NULL, 'key' => 'index'),
'rating' => array('type' => 'integer', 'null' => false, 'default' => NULL),
'points' => array('type' => 'integer', 'null' => false, 'default' => NULL),
'status' => array('type' => 'string', 'null' => true, 'default' => NULL, 'length' => 100, 'key' => 'index', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'mx_record' => array('type' => 'boolean', 'null' => false, 'default' => '0'),
'ip_address' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 20, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'created' => array('type' => 'datetime', 'null' => false, 'default' => NULL),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'active' => array('column' => 'active', 'unique' => 0), 'status' => array('column' => 'status', 'unique' => 0)),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
Expand Down
2 changes: 1 addition & 1 deletion Core/Comments/Config/config.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"id":"4c94edcb-9624-4ce3-acfe-78d86318cd70","name":"Comments","update_url":"infinitas-cms.org\/plugins\/version\/plugin:comments","version":"0.9","dependancies":[],"author":"Infinitas","website":"infinitas-cms.org","description":"See what your users have to say","license":"MIT"}
{"id":"4c94edcb-9624-4ce3-acfe-78d86318cd70","name":"Comments","update_url":"infinitas-cms.org\/plugins\/version\/plugin:comments","version":"0.9.1","dependancies":[],"author":"Infinitas","website":"infinitas-cms.org","description":"See what your users have to say","license":"MIT"}
82 changes: 82 additions & 0 deletions Core/Comments/Config/releases/000091_Comments.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?php
/**
* Infinitas Releas
*
* Auto generated database update
*/

class R4fbabc4eff8c4a3899594a0a6318cd70 extends CakeRelease {

/**
* Migration description
*
* @var string
* @access public
*/
public $description = 'Migration for Comments version 0.9.1';

/**
* Plugin name
*
* @var string
* @access public
*/
public $plugin = 'Comments';

/**
* Actions to be performed
*
* @var array $migration
* @access public
*/
public $migration = array(
'up' => array(
'create_field' => array(
'infinitas_comments' => array(
'mx_record' => array('type' => 'boolean', 'null' => false, 'default' => '0', 'after' => 'status'),
'ip_address' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 20, 'collate' => 'utf8_general_ci', 'charset' => 'utf8', 'after' => 'mx_record'),
),
),
'alter_field' => array(
'infinitas_comments' => array(
'foreign_id' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 36, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'user_id' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 36, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
),
),
),
'down' => array(
'drop_field' => array(
'infinitas_comments' => array('mx_record', 'ip_address',),
),
'alter_field' => array(
'infinitas_comments' => array(
'foreign_id' => array('type' => 'integer', 'null' => false, 'default' => NULL),
'user_id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 8),
),
),
),
);


/**
* 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;
}
}
2 changes: 2 additions & 0 deletions Core/Comments/Config/releases/map.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
$map = array(
1 => array(
'000009_Comments' => 'R4f56311fab8c4221afbf3e906318cd70'),
2 => array(
'000091_Comments' => 'R4fbabc4eff8c4a3899594a0a6318cd70'),
);
?>

0 comments on commit 0b8d46e

Please sign in to comment.