Skip to content

Commit

Permalink
Merge branch '2.2/develop' into 2.2/master
Browse files Browse the repository at this point in the history
  • Loading branch information
agentphoenix committed Apr 8, 2013
2 parents 1004d02 + 45a3a18 commit 14d9dfe
Show file tree
Hide file tree
Showing 8 changed files with 190 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 2.2.3 (7 April 2013)

### Bug Fixes

* Some users have reported errors being thrown during the update process that prevent them from moving up to newer versions of Nova. We've attempted to create a fix for this, but since we haven't been able to recreate the issue, this may or may not work.

## 2.2.2 (27 March 2013)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Anodyne Production's next-generation RPG management system combines popular feat

## Current Version

2.2.2
2.2.3

## Bug Tracker

Expand Down
2 changes: 1 addition & 1 deletion nova/modules/assets/install/data.php
Original file line number Diff line number Diff line change
Expand Up @@ -2244,7 +2244,7 @@
'sys_install_date' => now(),
'sys_version_major' => 2,
'sys_version_minor' => 2,
'sys_version_update' => 2)
'sys_version_update' => 3)
);

$tour_fields = array(
Expand Down
153 changes: 153 additions & 0 deletions nova/modules/assets/update/update_222.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Update Nova from 2.2.2 to 2.2.3
*/
$system_info = null;
$add_tables = null;
$drop_tables = null;
$rename_tables = null;
$add_column = null;
$modify_column = null;
$drop_column = null;

/**
* Version info for the database
*/
$system_info = array(
'sys_last_update' => now(),
'sys_version_major' => 2,
'sys_version_minor' => 2,
'sys_version_update' => 3,
);

/*
|---------------------------------------------------------------
| TABLES TO ADD
|
| $add_tables = array(
| 'table_name' => array(
| 'id' => 'table_id',
| 'fields' => 'fields_table_name')
| );
|
| $fields_table_name = array(
| 'table_id' => array(
| 'type' => 'INT',
| 'constraint' => 6,
| 'auto_increment' => TRUE),
| 'table_field_1' => array(
| 'type' => 'VARCHAR',
| 'constraint' => 255,
| 'default' => ''),
| 'table_field_2' => array(
| 'type' => 'INT',
| 'constraint' => 4,
| 'default' => '99')
| );
|---------------------------------------------------------------
*/

if ($add_tables !== null)
{
foreach ($add_tables as $key => $value)
{
$this->dbforge->add_field($$value['fields']);
$this->dbforge->add_key($value['id'], true);
$this->dbforge->create_table($key, true);
}
}

/*
|---------------------------------------------------------------
| TABLES TO DROP
|
| $drop_tables = array('table_name');
|---------------------------------------------------------------
*/

if ($drop_tables !== null)
{
foreach ($drop_tables as $value)
{
$this->dbforge->drop_table($value);
}
}

/*
|---------------------------------------------------------------
| TABLES TO RENAME
|
| $rename_tables = array('old_table_name' => 'new_table_name');
|---------------------------------------------------------------
*/

if ($rename_tables !== null)
{
foreach ($rename_tables as $key => $value)
{
$this->dbforge->rename_table($key, $value);
}
}

/*
|---------------------------------------------------------------
| COLUMNS TO ADD
|
| $add_column = array(
| 'table_name' => array(
| 'field_name_1' => array('type' => 'TEXT'),
| 'field_name_2' => array(
| 'type' => 'VARCHAR',
| 'constraint' => 100)
| )
| );
|---------------------------------------------------------------
*/

if ($add_column !== null)
{
foreach ($add_column as $key => $value)
{
$this->dbforge->add_column($key, $value);
}
}

/*
|---------------------------------------------------------------
| COLUMNS TO MODIFY
|
| $modify_column = array(
| 'table_name' => array(
| 'old_field_name' => array(
| 'name' => 'new_field_name',
| 'type' => 'TEXT')
| )
| );
|---------------------------------------------------------------
*/

if ($modify_column !== null)
{
foreach ($modify_column as $key => $value)
{
$this->dbforge->modify_column($key, $value);
}
}

/*
|---------------------------------------------------------------
| COLUMNS TO DROP
|
| $drop_column = array(
| 'table_name' => array('field_name')
| );
|---------------------------------------------------------------
*/

if ($drop_column !== null)
{
foreach ($drop_column as $key => $value)
{
$this->dbforge->drop_column($key, $value[0]);
}
}
2 changes: 1 addition & 1 deletion nova/modules/assets/update/versions.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
'120', '121', '122', '123', '124', '125', '126',
'200', '201', '202', '203',
'210', '211', '212', '213',
'220', '221', '222',
'220', '221', '222', '223',
);
6 changes: 3 additions & 3 deletions nova/modules/assets/version.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: 2.2.2
version: 2.2.3
version_major: 2
version_minor: 2
version_update: 2
version_update: 3
severity: minor
notes: |
Nova 2.2.2 fixes an issue where certain users couldn't create or edit wiki pages as well as an error thrown when managing NPCs (thanks to evshell18 for the pull request on this one).
Nova 2.2.3 attempts to fix a long-standing issue for some users when updating to newer versions of Nova.
date: 27 March 2013
link: http://www.anodyne-productions.com/nova/index.php
4 changes: 2 additions & 2 deletions nova/modules/core/config/info.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

define('APP_NAME', 'Nova');

define('APP_VERSION', '2.2.2');
define('APP_VERSION', '2.2.3');
define('APP_VERSION_MAJOR', 2);
define('APP_VERSION_MINOR', 2);
define('APP_VERSION_UPDATE', 2);
define('APP_VERSION_UPDATE', 3);

define('WIKI_NAME', 'Thresher');
define('WIKI_VERSION', 'Release 2');
Expand Down
25 changes: 23 additions & 2 deletions nova/modules/core/models/nova_system_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -610,10 +610,31 @@ public function update_skin_section($id = '', $data = '', $where = array())
return $query;
}

public function update_system_info($data = '')
/**
* Update the system info.
*
* @param array Array of data to use in the update
* @return int
*/
public function update_system_info($data = false)
{
if ( ! is_array($data))
{
$this->db->set('sys_last_update', now());
$this->db->set('sys_version_major', APP_VERSION_MAJOR);
$this->db->set('sys_version_minor', APP_VERSION_MINOR);
$this->db->set('sys_version_update', APP_VERSION_UPDATE);
}
else
{
$this->db->set('sys_last_update', $data['sys_last_update']);
$this->db->set('sys_version_major', $data['sys_version_major']);
$this->db->set('sys_version_minor', $data['sys_version_minor']);
$this->db->set('sys_version_update', $data['sys_version_update']);
}

$this->db->where('sys_id', 1);
$query = $this->db->update('system_info', $data);
$query = $this->db->update('system_info');

$this->dbutil->optimize_table('system_info');

Expand Down

0 comments on commit 14d9dfe

Please sign in to comment.