Custom tasks extension, basic implementation
This commit is contained in:
33
extensions/tasks/src/Tasks/Migration.php
Normal file
33
extensions/tasks/src/Tasks/Migration.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
namespace Tasks;
|
||||
|
||||
use Classes\Migration\AbstractMigration;
|
||||
|
||||
class Migration extends AbstractMigration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$sql = <<<'SQL'
|
||||
create table `Tasks` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`employee` bigint(20) NULL,
|
||||
`name` varchar(250) NOT NULL,
|
||||
`description` TEXT NULL,
|
||||
`attachment` varchar(100) NULL,
|
||||
`created` DATETIME default NULL,
|
||||
`updated` DATETIME default NULL,
|
||||
primary key (`id`),
|
||||
CONSTRAINT `Fk_EmployeeTasks_Employees` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) engine=innodb default charset=utf8;
|
||||
SQL;
|
||||
return $this->executeQuery($sql);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$sql = <<<'SQL'
|
||||
DROP TABLE IF EXISTS `Tasks`;
|
||||
SQL;
|
||||
return $this->executeQuery($sql);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user