mirror of
https://github.com/Karaka-Management/oms-Profile.git
synced 2026-02-12 13:58:40 +00:00
Use default database connection
This commit is contained in:
parent
70144fc214
commit
216fe6514b
|
|
@ -38,10 +38,10 @@ class Installer extends InstallerAbstract
|
||||||
{
|
{
|
||||||
parent::install(__DIR__ . '/..', $dbPool, $info);
|
parent::install(__DIR__ . '/..', $dbPool, $info);
|
||||||
|
|
||||||
switch ($dbPool->get('core')->getType()) {
|
switch ($dbPool->get()->getType()) {
|
||||||
case DatabaseType::MYSQL:
|
case DatabaseType::MYSQL:
|
||||||
$dbPool->get('core')->con->prepare(
|
$dbPool->get()->con->prepare(
|
||||||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'profile_account` (
|
'CREATE TABLE if NOT EXISTS `' . $dbPool->get()->prefix . 'profile_account` (
|
||||||
`profile_account_id` int(11) NOT NULL AUTO_INCREMENT,
|
`profile_account_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`profile_account_image` int(11) DEFAULT NULL,
|
`profile_account_image` int(11) DEFAULT NULL,
|
||||||
`profile_account_birthday` datetime DEFAULT NULL,
|
`profile_account_birthday` datetime DEFAULT NULL,
|
||||||
|
|
@ -52,15 +52,15 @@ class Installer extends InstallerAbstract
|
||||||
)ENGINE=InnoDB DEFAULT CHARSET=utf8;'
|
)ENGINE=InnoDB DEFAULT CHARSET=utf8;'
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
$dbPool->get('core')->con->prepare(
|
$dbPool->get()->con->prepare(
|
||||||
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'profile_account`
|
'ALTER TABLE `' . $dbPool->get()->prefix . 'profile_account`
|
||||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'profile_account_ibfk_1` FOREIGN KEY (`profile_account_image`) REFERENCES `' . $dbPool->get('core')->prefix . 'media` (`media_id`),
|
ADD CONSTRAINT `' . $dbPool->get()->prefix . 'profile_account_ibfk_1` FOREIGN KEY (`profile_account_image`) REFERENCES `' . $dbPool->get()->prefix . 'media` (`media_id`),
|
||||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'profile_account_ibfk_2` FOREIGN KEY (`profile_account_account`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`);'
|
ADD CONSTRAINT `' . $dbPool->get()->prefix . 'profile_account_ibfk_2` FOREIGN KEY (`profile_account_account`) REFERENCES `' . $dbPool->get()->prefix . 'account` (`account_id`);'
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
// real contacts that you also save in your email contact list. this is to store other accounts
|
// real contacts that you also save in your email contact list. this is to store other accounts
|
||||||
$dbPool->get('core')->con->prepare(
|
$dbPool->get()->con->prepare(
|
||||||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'profile_contact` (
|
'CREATE TABLE if NOT EXISTS `' . $dbPool->get()->prefix . 'profile_contact` (
|
||||||
`profile_contact_id` int(11) NOT NULL AUTO_INCREMENT,
|
`profile_contact_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`profile_contact_name1` varchar(250) NOT NULL,
|
`profile_contact_name1` varchar(250) NOT NULL,
|
||||||
`profile_contact_name2` varchar(250) NOT NULL,
|
`profile_contact_name2` varchar(250) NOT NULL,
|
||||||
|
|
@ -77,14 +77,14 @@ class Installer extends InstallerAbstract
|
||||||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
$dbPool->get('core')->con->prepare(
|
$dbPool->get()->con->prepare(
|
||||||
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'profile_contact`
|
'ALTER TABLE `' . $dbPool->get()->prefix . 'profile_contact`
|
||||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'profile_contact_ibfk_1` FOREIGN KEY (`profile_contact_account`) REFERENCES `' . $dbPool->get('core')->prefix . 'profile_account` (`profile_account_id`);'
|
ADD CONSTRAINT `' . $dbPool->get()->prefix . 'profile_contact_ibfk_1` FOREIGN KEY (`profile_contact_account`) REFERENCES `' . $dbPool->get()->prefix . 'profile_account` (`profile_account_id`);'
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
// email, phone etc for profile_contact
|
// email, phone etc for profile_contact
|
||||||
$dbPool->get('core')->con->prepare(
|
$dbPool->get()->con->prepare(
|
||||||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'profile_contact_element` (
|
'CREATE TABLE if NOT EXISTS `' . $dbPool->get()->prefix . 'profile_contact_element` (
|
||||||
`profile_contact_element_id` int(11) NOT NULL AUTO_INCREMENT,
|
`profile_contact_element_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`profile_contact_element_type` tinyint(2) NOT NULL,
|
`profile_contact_element_type` tinyint(2) NOT NULL,
|
||||||
`profile_contact_element_subtype` tinyint(2) NOT NULL,
|
`profile_contact_element_subtype` tinyint(2) NOT NULL,
|
||||||
|
|
@ -95,14 +95,14 @@ class Installer extends InstallerAbstract
|
||||||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
$dbPool->get('core')->con->prepare(
|
$dbPool->get()->con->prepare(
|
||||||
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'profile_contact_element`
|
'ALTER TABLE `' . $dbPool->get()->prefix . 'profile_contact_element`
|
||||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'profile_contact_element_ibfk_1` FOREIGN KEY (`profile_contact_element_contact`) REFERENCES `' . $dbPool->get('core')->prefix . 'profile_contact` (`profile_contact_id`);'
|
ADD CONSTRAINT `' . $dbPool->get()->prefix . 'profile_contact_element_ibfk_1` FOREIGN KEY (`profile_contact_element_contact`) REFERENCES `' . $dbPool->get()->prefix . 'profile_contact` (`profile_contact_id`);'
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
// not a full contact only the element like email, phone etc. for the accounts themselves (not profile_account)
|
// not a full contact only the element like email, phone etc. for the accounts themselves (not profile_account)
|
||||||
$dbPool->get('core')->con->prepare(
|
$dbPool->get()->con->prepare(
|
||||||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'profile_contactelement` (
|
'CREATE TABLE if NOT EXISTS `' . $dbPool->get()->prefix . 'profile_contactelement` (
|
||||||
`profile_contactelement_id` int(11) NOT NULL AUTO_INCREMENT,
|
`profile_contactelement_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`profile_contactelement_type` tinyint(2) NOT NULL,
|
`profile_contactelement_type` tinyint(2) NOT NULL,
|
||||||
`profile_contactelement_subtype` tinyint(2) NOT NULL,
|
`profile_contactelement_subtype` tinyint(2) NOT NULL,
|
||||||
|
|
@ -113,13 +113,13 @@ class Installer extends InstallerAbstract
|
||||||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
$dbPool->get('core')->con->prepare(
|
$dbPool->get()->con->prepare(
|
||||||
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'profile_contactelement`
|
'ALTER TABLE `' . $dbPool->get()->prefix . 'profile_contactelement`
|
||||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'profile_contactelement_ibfk_1` FOREIGN KEY (`profile_contactelement_account`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`);'
|
ADD CONSTRAINT `' . $dbPool->get()->prefix . 'profile_contactelement_ibfk_1` FOREIGN KEY (`profile_contactelement_account`) REFERENCES `' . $dbPool->get()->prefix . 'account` (`account_id`);'
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
$dbPool->get('core')->con->prepare(
|
$dbPool->get()->con->prepare(
|
||||||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'profile_address` (
|
'CREATE TABLE if NOT EXISTS `' . $dbPool->get()->prefix . 'profile_address` (
|
||||||
`profile_address_id` int(11) NOT NULL AUTO_INCREMENT,
|
`profile_address_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`profile_address_type` tinyint(2) NOT NULL,
|
`profile_address_type` tinyint(2) NOT NULL,
|
||||||
`profile_address_address` varchar(255) NOT NULL,
|
`profile_address_address` varchar(255) NOT NULL,
|
||||||
|
|
@ -133,13 +133,13 @@ class Installer extends InstallerAbstract
|
||||||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
$dbPool->get('core')->con->prepare(
|
$dbPool->get()->con->prepare(
|
||||||
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'profile_address`
|
'ALTER TABLE `' . $dbPool->get()->prefix . 'profile_address`
|
||||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'profile_address_ibfk_1` FOREIGN KEY (`profile_address_account`) REFERENCES `' . $dbPool->get('core')->prefix . 'profile_account` (`profile_account_id`);'
|
ADD CONSTRAINT `' . $dbPool->get()->prefix . 'profile_address_ibfk_1` FOREIGN KEY (`profile_address_account`) REFERENCES `' . $dbPool->get()->prefix . 'profile_account` (`profile_account_id`);'
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
$dbPool->get('core')->con->prepare(
|
$dbPool->get()->con->prepare(
|
||||||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'profile_account_relation` (
|
'CREATE TABLE if NOT EXISTS `' . $dbPool->get()->prefix . 'profile_account_relation` (
|
||||||
`profile_account_relation_id` int(11) NOT NULL AUTO_INCREMENT,
|
`profile_account_relation_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`profile_account_relation_type` tinyint(2) NOT NULL,
|
`profile_account_relation_type` tinyint(2) NOT NULL,
|
||||||
`profile_account_relation_relation` int(11) DEFAULT NULL,
|
`profile_account_relation_relation` int(11) DEFAULT NULL,
|
||||||
|
|
@ -149,13 +149,13 @@ class Installer extends InstallerAbstract
|
||||||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
$dbPool->get('core')->con->prepare(
|
$dbPool->get()->con->prepare(
|
||||||
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'profile_account_relation`
|
'ALTER TABLE `' . $dbPool->get()->prefix . 'profile_account_relation`
|
||||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'profile_account_relation_ibfk_1` FOREIGN KEY (`profile_account_relation_account`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`);'
|
ADD CONSTRAINT `' . $dbPool->get()->prefix . 'profile_account_relation_ibfk_1` FOREIGN KEY (`profile_account_relation_account`) REFERENCES `' . $dbPool->get()->prefix . 'account` (`account_id`);'
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
$dbPool->get('core')->con->prepare(
|
$dbPool->get()->con->prepare(
|
||||||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'profile_account_setting` (
|
'CREATE TABLE if NOT EXISTS `' . $dbPool->get()->prefix . 'profile_account_setting` (
|
||||||
`profile_account_setting_id` int(11) NOT NULL AUTO_INCREMENT,
|
`profile_account_setting_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`profile_account_setting_module` int(11) NOT NULL,
|
`profile_account_setting_module` int(11) NOT NULL,
|
||||||
`profile_account_setting_type` varchar(20) NOT NULL,
|
`profile_account_setting_type` varchar(20) NOT NULL,
|
||||||
|
|
@ -166,9 +166,9 @@ class Installer extends InstallerAbstract
|
||||||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
$dbPool->get('core')->con->prepare(
|
$dbPool->get()->con->prepare(
|
||||||
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'profile_account_setting`
|
'ALTER TABLE `' . $dbPool->get()->prefix . 'profile_account_setting`
|
||||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'profile_account_setting_ibfk_1` FOREIGN KEY (`profile_account_setting_account`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`);'
|
ADD CONSTRAINT `' . $dbPool->get()->prefix . 'profile_account_setting_ibfk_1` FOREIGN KEY (`profile_account_setting_account`) REFERENCES `' . $dbPool->get()->prefix . 'account` (`account_id`);'
|
||||||
)->execute();
|
)->execute();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ class Uninstall extends UninstallAbstract
|
||||||
|
|
||||||
$query = new Builder($dbPool->get());
|
$query = new Builder($dbPool->get());
|
||||||
|
|
||||||
$query->prefix($dbPool->get('core')->getPrefix())->drop(
|
$query->prefix($dbPool->get()->getPrefix())->drop(
|
||||||
'profile_account_setting',
|
'profile_account_setting',
|
||||||
'profile_account_relation',
|
'profile_account_relation',
|
||||||
'profile_address',
|
'profile_address',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user