-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.php
49 lines (34 loc) · 1.42 KB
/
install.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
defined('_JEXEC') or die('Restricted access');
class CrBcInstallation extends CrBcInstaller {
public $type = 'payment';
public $name = 'paystack';
function install(){
$tables = JFactory::getDBO()->getTableList();
settype($tables, 'array');
foreach ($tables as $table){
if( $table == JFactory::getDBO()->getPrefix() . 'breezingcommerce_plugin_payment_paystack' ){
return;
}
}
$db = JFactory::getDBO();
$db->setQuery("CREATE TABLE IF NOT EXISTS `#__breezingcommerce_plugin_payment_paystack` (
`identity` int(11) NOT NULL,
`test_account` tinyint(4) NOT NULL DEFAULT '0',
`tsk` varchar(255) NOT NULL,
`tpk` varchar(255) NOT NULL,
`lsk` varchar(255) NOT NULL,
`lpk` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8
");
$db->query();
$db->setQuery("ALTER TABLE `#__breezingcommerce_plugin_payment_paystack`
ADD PRIMARY KEY (`identity`)
");
$db->query();
$db->setQuery("ALTER TABLE `#__breezingcommerce_plugin_payment_paystack`
MODIFY `identity` int(11) NOT NULL AUTO_INCREMENT
");
$db->query();
}
}