[ticket/17010] Add migration for notificatio_push table

PHPBB3-17010
This commit is contained in:
Marc Alexander 2022-08-19 22:43:52 +02:00
parent 5c51f2ef7f
commit 3feeb237ca
No known key found for this signature in database
GPG key ID: 50E0D2423696F995

View file

@ -0,0 +1,55 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\db\migration\data\v400;
use phpbb\db\migration\migration;
class add_notification_push_table extends migration
{
public static function depends_on(): array
{
return [
'\phpbb\db\migration\data\v400\dev',
];
}
public function effectively_installed(): bool
{
return $this->db_tools->sql_table_exists($this->table_prefix . 'notification_push');
}
public function update_schema(): array
{
return [
'add_tables' => [
$this->table_prefix . 'notification_push' => [
'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(): array
{
return [
'drop_tables' => [$this->table_prefix . 'notification_push'],
];
}
}