-
Notifications
You must be signed in to change notification settings - Fork 1
/
Setup.php
33 lines (28 loc) · 873 Bytes
/
Setup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
namespace VersoBit\ResourceTickets;
use XF\AddOn\AbstractSetup;
use XF\Db\Schema\Alter;
class Setup extends AbstractSetup
{
public function install(array $stepParams = [])
{
// Add ticket foreign key to resource table
$this->schemaManager()->alterTable('xf_rm_resource', function(Alter $table)
{
$table->addColumn('ticket_id', 'int')->comment('Points to an automatically-created ticket for the resource update');
$table->addKey('ticket_id');
});
}
public function upgrade(array $stepParams = [])
{
// TODO: Implement upgrade() method.
}
public function uninstall(array $stepParams = [])
{
// Remove ticket foreign key from resource table
$this->schemaManager()->alterTable('xf_rm_resource', function(Alter $table)
{
$table->dropColumns('ticket_id');
});
}
}