-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetup.php
More file actions
40 lines (34 loc) · 945 Bytes
/
Copy pathSetup.php
File metadata and controls
40 lines (34 loc) · 945 Bytes
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
34
35
36
37
38
39
40
<?php
namespace Jaysc\QuoteBy;
use XF\AddOn\AbstractSetup;
use XF\AddOn\StepRunnerInstallTrait;
use XF\AddOn\StepRunnerUninstallTrait;
use XF\AddOn\StepRunnerUpgradeTrait;
use XF\Db\Schema\Create;
class Setup extends AbstractSetup
{
use StepRunnerInstallTrait;
use StepRunnerUpgradeTrait;
use StepRunnerUninstallTrait;
public function installStep1()
{
$this->schemaManager()->createTable('xf_jaysc_quote_by', function (Create $table) {
$table->addColumn('parent_post_id', 'int');
$table->addColumn('post_id', 'int');
$table->addColumn('thread_id', 'int');
$table->addPrimaryKey(['parent_post_id', 'post_id']);
});
}
public function installStep2()
{
$this->app()->jobManager()
->enqueueUnique(
'jaysc_quoteBy_build',
'Jaysc\QuoteBy:QuoteByBuild'
);
}
public function uninstallStep1()
{
$this->schemaManager()->dropTable('xf_jaysc_quote_by');
}
}