Version 0.1.2
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
namespace dmzx\mchat\migrations;
|
||||
|
||||
class mchat_module extends \phpbb\db\migration\migration
|
||||
class mchat_module_acp extends \phpbb\db\migration\migration
|
||||
{
|
||||
|
||||
public function update_data()
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
namespace dmzx\mchat\migrations;
|
||||
|
||||
class mchat_schema_6 extends \phpbb\db\migration\migration
|
||||
class mchat_module_cat extends \phpbb\db\migration\migration
|
||||
{
|
||||
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\dmzx\mchat\migrations\mchat_schema_5',
|
||||
'\dmzx\mchat\migrations\mchat_schema',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -23,26 +23,26 @@ class mchat_schema_6 extends \phpbb\db\migration\migration
|
||||
{
|
||||
return array(
|
||||
array('module.add', array('acp', 'ACP_CAT_USERS', array(
|
||||
'module_basename' => 'users',
|
||||
'module_enabled' => 1,
|
||||
'module_display' => 0,
|
||||
'module_langname' => 'ACP_USER_MCHAT',
|
||||
'module_mode' => 'mchat',
|
||||
'module_auth' => 'acl_a_user',
|
||||
'module_basename' => 'users',
|
||||
'module_enabled' => 1,
|
||||
'module_display' => 0,
|
||||
'module_langname' => 'ACP_USER_MCHAT',
|
||||
'module_mode' => 'mchat',
|
||||
'module_auth' => 'acl_a_user',
|
||||
),
|
||||
),
|
||||
),
|
||||
// First, lets add a new category named UCP_CAT_MCHAT
|
||||
array('ucp', false, 'UCP_CAT_MCHAT'),
|
||||
// First, lets add a new category named UCP_CAT_MCHAT
|
||||
array('ucp', false, 'UCP_CAT_MCHAT'),
|
||||
|
||||
// next let's add our module
|
||||
array('ucp', 'UCP_CAT_MCHAT', array(
|
||||
// next let's add our module
|
||||
array('ucp', 'UCP_CAT_MCHAT', array(
|
||||
'module_basename' => 'mchat',
|
||||
'modes' => array('configuration'),
|
||||
'module_auth' => 'u_mchat_use',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
namespace dmzx\mchat\migrations;
|
||||
|
||||
class mchat_module1 extends \phpbb\db\migration\migration
|
||||
class mchat_module_ucp extends \phpbb\db\migration\migration
|
||||
{
|
||||
|
||||
public function update_data()
|
||||
@@ -11,6 +11,7 @@ namespace dmzx\mchat\migrations;
|
||||
|
||||
class mchat_schema extends \phpbb\db\migration\migration
|
||||
{
|
||||
var $ext_version = '0.1.2';
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
@@ -25,7 +26,7 @@ class mchat_schema extends \phpbb\db\migration\migration
|
||||
array('config.add', array('mchat_new_posts_quote', false)),
|
||||
array('config.add', array('mchat_message_top', true)),
|
||||
array('config.add', array('mchat_stats_index', false)),
|
||||
array('config.add', array('mchat_version','0.1.1')),
|
||||
array('config.add', array('mchat_version', $this->ext_version)),
|
||||
|
||||
// Add permissions
|
||||
array('permission.add', array('u_mchat_use')),
|
||||
@@ -78,6 +79,42 @@ class mchat_schema extends \phpbb\db\migration\migration
|
||||
),
|
||||
'PRIMARY_KEY' => 'config_name',
|
||||
),
|
||||
|
||||
$this->table_prefix . 'mchat' => array(
|
||||
'COLUMNS' => array(
|
||||
'message_id' => array('UINT', NULL, 'auto_increment'),
|
||||
'user_id' => array('UINT', 0),
|
||||
'user_ip' => array('VCHAR:40', ''),
|
||||
'message' => array('MTEXT_UNI', ''),
|
||||
'bbcode_bitfield' => array('VCHAR', ''),
|
||||
'bbcode_uid' => array('VCHAR:8', ''),
|
||||
'bbcode_options' => array('BOOL', '7'),
|
||||
'message_time' => array('INT:11', 0),
|
||||
'forum_id' => array('UINT', 0),
|
||||
'post_id' => array('UINT', 0),
|
||||
),
|
||||
'PRIMARY_KEY' => 'message_id',
|
||||
),
|
||||
|
||||
$this->table_prefix . 'mchat_sessions' => array(
|
||||
'COLUMNS' => array(
|
||||
'user_id' => array('UINT', 0),
|
||||
'user_lastupdate' => array('TIMESTAMP', 0),
|
||||
'user_ip' => array('VCHAR:40', ''),
|
||||
),
|
||||
'PRIMARY_KEY' => 'user_id',
|
||||
),
|
||||
),
|
||||
|
||||
'add_columns' => array(
|
||||
$this->table_prefix . 'users' => array(
|
||||
'user_mchat_index' => array('BOOL', '1'),
|
||||
'user_mchat_sound' => array('BOOL', '1'),
|
||||
'user_mchat_stats_index' => array('BOOL', '1'),
|
||||
'user_mchat_topics' => array('BOOL', '1'),
|
||||
'user_mchat_avatars' => array('BOOL', '1'),
|
||||
'user_mchat_input_area' => array('BOOL', '1'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -86,8 +123,21 @@ class mchat_schema extends \phpbb\db\migration\migration
|
||||
{
|
||||
return array(
|
||||
'drop_tables' => array(
|
||||
$this->table_prefix . 'mchat',
|
||||
$this->table_prefix . 'mchat_sessions',
|
||||
$this->table_prefix . 'mchat_config',
|
||||
),
|
||||
|
||||
'drop_columns' => array(
|
||||
$this->table_prefix . 'users' => array(
|
||||
'user_mchat_index',
|
||||
'user_mchat_sound',
|
||||
'user_mchat_stats_index',
|
||||
'user_mchat_topics',
|
||||
'user_mchat_avatars',
|
||||
'user_mchat_input_area',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package phpBB Extension - mChat
|
||||
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
namespace dmzx\mchat\migrations;
|
||||
|
||||
class mchat_schema_2 extends \phpbb\db\migration\migration
|
||||
{
|
||||
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\dmzx\mchat\migrations\mchat_schema',
|
||||
);
|
||||
}
|
||||
public function update_schema()
|
||||
{
|
||||
return array(
|
||||
'add_tables' => array(
|
||||
$this->table_prefix . 'mchat' => array(
|
||||
'COLUMNS' => array(
|
||||
'message_id' => array('UINT', NULL, 'auto_increment'),
|
||||
'user_id' => array('UINT', 0),
|
||||
'user_ip' => array('VCHAR:40', ''),
|
||||
'message' => array('MTEXT_UNI', ''),
|
||||
'bbcode_bitfield' => array('VCHAR', ''),
|
||||
'bbcode_uid' => array('VCHAR:8', ''),
|
||||
'bbcode_options' => array('BOOL', '7'),
|
||||
'message_time' => array('INT:11', 0),
|
||||
'forum_id' => array('UINT', 0),
|
||||
'post_id' => array('UINT', 0),
|
||||
),
|
||||
'PRIMARY_KEY' => 'message_id',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
public function revert_schema()
|
||||
{
|
||||
return array(
|
||||
'drop_tables' => array(
|
||||
$this->table_prefix . 'mchat',
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package phpBB Extension - mChat
|
||||
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
namespace dmzx\mchat\migrations;
|
||||
|
||||
class mchat_schema_4 extends \phpbb\db\migration\migration
|
||||
{
|
||||
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\dmzx\mchat\migrations\mchat_schema_3',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_schema()
|
||||
{
|
||||
return array(
|
||||
'add_columns' => array(
|
||||
$this->table_prefix . 'users' => array(
|
||||
'user_mchat_index' => array('BOOL', '1'),
|
||||
'user_mchat_sound' => array('BOOL', '1'),
|
||||
'user_mchat_stats_index' => array('BOOL', '1'),
|
||||
'user_mchat_topics' => array('BOOL', '1'),
|
||||
'user_mchat_avatars' => array('BOOL', '1'),
|
||||
'user_mchat_input_area' => array('BOOL', '1'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
public function revert_schema()
|
||||
{
|
||||
return array(
|
||||
'drop_columns' => array(
|
||||
$this->table_prefix . 'users' => array(
|
||||
'user_mchat_index',
|
||||
'user_mchat_sound',
|
||||
'user_mchat_stats_index',
|
||||
'user_mchat_topics',
|
||||
'user_mchat_avatars',
|
||||
'user_mchat_input_area',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package phpBB Extension - mChat
|
||||
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
namespace dmzx\mchat\migrations;
|
||||
|
||||
class mchat_schema_5 extends \phpbb\db\migration\migration
|
||||
{
|
||||
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\dmzx\mchat\migrations\mchat_schema_4',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_schema()
|
||||
{
|
||||
return array(
|
||||
'add_tables' => array(
|
||||
$this->table_prefix . 'mchat_sessions' => array(
|
||||
'COLUMNS' => array(
|
||||
'user_id' => array('UINT', 0),
|
||||
'user_lastupdate' => array('TIMESTAMP', 0),
|
||||
'user_ip' => array('VCHAR:40', ''),
|
||||
),
|
||||
'PRIMARY_KEY' => 'user_id',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
public function revert_schema()
|
||||
{
|
||||
return array(
|
||||
'drop_tables' => array(
|
||||
$this->table_prefix . 'mchat_sessions',
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
namespace dmzx\mchat\migrations;
|
||||
|
||||
class mchat_schema_3 extends \phpbb\db\migration\migration
|
||||
class mchat_schema_sample_data extends \phpbb\db\migration\migration
|
||||
{
|
||||
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\dmzx\mchat\migrations\mchat_schema_2',
|
||||
'\dmzx\mchat\migrations\mchat_schema',
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user