1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-21 00:02:18 +02:00

[ticket/14754] Refactor migration for 3.3 and use ULINT

PHPBB3-14754
This commit is contained in:
Marc Alexander 2020-03-15 12:50:39 +01:00
parent cc3afd87aa
commit c61946329c
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995

View File

@ -11,40 +11,38 @@
*
*/
namespace phpbb\db\migration\data\v32x;
namespace phpbb\db\migration\data\v33x;
class add_email_notifications_table extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v32x\v323',
);
return [
'\phpbb\db\migration\data\v330\v330',
];
}
public function update_schema()
{
return array(
'add_tables' => array(
$this->table_prefix . 'email_notifications' => array(
'COLUMNS' => array(
'notification_type_id' => array('USINT', 0),
'item_id' => array('UINT', 0),
'item_parent_id' => array('UINT', 0),
'user_id' => array('UINT', 0),
),
'PRIMARY_KEY' => array('notification_type_id', 'item_id', 'item_parent_id', 'user_id'),
),
),
);
return [
'add_tables' => [
$this->table_prefix . 'email_notifications' => [
'COLUMNS' => [
'notification_type_id' => ['USINT', 0],
'item_id' => ['ULINT', 0],
'item_parent_id' => ['ULINT', 0],
'user_id' => ['ULINT', 0],
],
'PRIMARY_KEY' => ['notification_type_id', 'item_id', 'item_parent_id', 'user_id'],
],
],
];
}
public function revert_schema()
{
return array(
'drop_tables' => array(
$this->table_prefix . 'email_notifications',
),
);
return [
'drop_tables' => [$this->table_prefix . 'email_notifications'],
];
}
}