mirror of
https://github.com/Karaka-Management/oms-ProjectManagement.git
synced 2026-01-24 21:38:43 +00:00
Fix installation/mapper
This commit is contained in:
parent
764ed7c47f
commit
7f57c0ddae
|
|
@ -54,14 +54,18 @@ class Installer extends InstallerAbstract
|
|||
`projectmanagement_project_earnings` int(11) NOT NULL,
|
||||
`projectmanagement_project_start` datetime NOT NULL,
|
||||
`projectmanagement_project_end` datetime NOT NULL,
|
||||
`projectmanagement_project_created_at` datetime NOT NULL,
|
||||
`projectmanagement_project_created_by` int(11) NOT NULL,
|
||||
PRIMARY KEY (`projectmanagement_project_id`),
|
||||
KEY `projectmanagement_project_calendar` (`projectmanagement_project_calendar`)
|
||||
KEY `projectmanagement_project_calendar` (`projectmanagement_project_calendar`),
|
||||
KEY `projectmanagement_project_created_by` (`projectmanagement_project_created_by`)
|
||||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
||||
)->execute();
|
||||
|
||||
$dbPool->get('core')->con->prepare(
|
||||
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'projectmanagement_project`
|
||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'projectmanagement_project_ibfk_1` FOREIGN KEY (`projectmanagement_project_calendar`) REFERENCES `' . $dbPool->get('core')->prefix . 'calendar` (`calendar_id`);'
|
||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'projectmanagement_project_ibfk_1` FOREIGN KEY (`projectmanagement_project_calendar`) REFERENCES `' . $dbPool->get('core')->prefix . 'calendar` (`calendar_id`),
|
||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'projectmanagement_project_ibfk_2` FOREIGN KEY (`projectmanagement_project_created_by`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`);'
|
||||
)->execute();
|
||||
|
||||
$dbPool->get('core')->con->prepare(
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ use phpOMS\DataStorage\Database\DataMapperAbstract;
|
|||
use phpOMS\DataStorage\Database\Query\Builder;
|
||||
use phpOMS\DataStorage\Database\Query\Column;
|
||||
use phpOMS\DataStorage\Database\RelationType;
|
||||
use Modules\Tasks\Models\TaskMapper;
|
||||
|
||||
/**
|
||||
* Mapper class.
|
||||
|
|
@ -51,6 +52,23 @@ class ProjectMapper extends DataMapperAbstract
|
|||
'projectmanagement_project_earnings' => ['name' => 'projectmanagement_project_earnings', 'type' => 'Serializable', 'internal' => 'earnings'],
|
||||
'projectmanagement_project_start' => ['name' => 'projectmanagement_project_start', 'type' => 'DateTime', 'internal' => 'start'],
|
||||
'projectmanagement_project_end' => ['name' => 'projectmanagement_project_end', 'type' => 'DateTime', 'internal' => 'end'],
|
||||
'projectmanagement_project_created_by' => ['name' => 'projectmanagement_project_created_by', 'type' => 'int', 'internal' => 'createdBy'],
|
||||
'projectmanagement_project_created_at' => ['name' => 'projectmanagement_project_created_at', 'type' => 'DateTime', 'internal' => 'createdAt'],
|
||||
];
|
||||
|
||||
/**
|
||||
* Has many relation.
|
||||
*
|
||||
* @var array
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $hasMany = [
|
||||
'tasks' => [
|
||||
'mapper' => TaskMapper::class,
|
||||
'table' => 'projectmanagement_task_relation',
|
||||
'dst' => 'projectmanagement_task_relation_dst',
|
||||
'src' => 'projectmanagement_task_relation_src',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -66,15 +84,6 @@ class ProjectMapper extends DataMapperAbstract
|
|||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Has many relation.
|
||||
*
|
||||
* @var array
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $hasMany = [
|
||||
];
|
||||
|
||||
/**
|
||||
* Primary table.
|
||||
*
|
||||
|
|
@ -83,6 +92,14 @@ class ProjectMapper extends DataMapperAbstract
|
|||
*/
|
||||
protected static $table = 'projectmanagement_project';
|
||||
|
||||
/**
|
||||
* Created at.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $createdAt = 'projectmanagement_project_created_at';
|
||||
|
||||
/**
|
||||
* Primary field name.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user