Fixing hasOne schedule bugs

This commit is contained in:
Dennis Eichhorn 2016-02-13 20:04:35 +01:00
parent ed7b69c0d2
commit 3afafd5891
3 changed files with 8 additions and 3 deletions

View File

@ -53,16 +53,19 @@ class Installer extends InstallerAbstract
`task_status` tinyint(1) NOT NULL, `task_status` tinyint(1) NOT NULL,
`task_due` datetime NOT NULL, `task_due` datetime NOT NULL,
`task_done` datetime DEFAULT NULL, `task_done` datetime DEFAULT NULL,
`task_schedule` int(11) DEFAULT NULL,
`task_created_by` int(11) NOT NULL, `task_created_by` int(11) NOT NULL,
`task_created_at` datetime NOT NULL, `task_created_at` datetime NOT NULL,
PRIMARY KEY (`task_id`), PRIMARY KEY (`task_id`),
KEY `task_creator` (`task_created_by`) KEY `task_schedule` (`task_schedule`),
KEY `task_created_by` (`task_created_by`)
)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('core')->con->prepare(
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'task` 'ALTER TABLE `' . $dbPool->get('core')->prefix . 'task`
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'task_ibfk_1` FOREIGN KEY (`task_created_by`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`);' ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'task_ibfk_1` FOREIGN KEY (`task_schedule`) REFERENCES `' . $dbPool->get('core')->prefix . 'schedule` (`schedule_id`),
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'task_ibfk_2` FOREIGN KEY (`task_created_by`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`);'
)->execute(); )->execute();
$dbPool->get('core')->con->prepare( $dbPool->get('core')->con->prepare(

View File

@ -120,6 +120,7 @@ class TaskMapper extends DataMapperAbstract
try { try {
$objId = parent::create($obj); $objId = parent::create($obj);
$query = new Builder($this->db); $query = new Builder($this->db);
$query->prefix($this->db->getPrefix()) $query->prefix($this->db->getPrefix())
->insert( ->insert(
'account_permission_account', 'account_permission_account',

View File

@ -16,7 +16,8 @@
"description": "Tasks module.", "description": "Tasks module.",
"directory": "Tasks", "directory": "Tasks",
"dependencies": { "dependencies": {
"Admin" : "1.0.0" "Admin" : "1.0.0",
"Calendar" : "1.0.0"
}, },
"providing": { "providing": {
"Navigation": "*" "Navigation": "*"