Skip to content

Commit

Permalink
Adding DB attribute to imported projects from trello
Browse files Browse the repository at this point in the history
  • Loading branch information
wiltonsr committed May 6, 2019
1 parent 2f5d845 commit 53f3b1a
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Controller/TrelloJSON2KanboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ public function save()
} else {
$project = $this->trelloJSON2KanboardModel->parserJSON($jsonObj);

$values += array('name' => $project->name);
$values += array(
'name' => $project->name,
);

$max_attachment_size = $this->helper->text->phpTobytes(get_upload_max_size());

Expand Down Expand Up @@ -155,6 +157,7 @@ private function createNewProject(array $values)
$project = array(
'name' => $values['name'],
'is_private' => $values['is_private'],
'is_trello_imported' => 1,
);

return $this->projectModel->create($project, $this->userSession->getId(), true);
Expand Down
2 changes: 1 addition & 1 deletion Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function getPluginAuthor()

public function getPluginVersion()
{
return '1.2.1';
return '1.2.2';
}

public function getPluginHomepage()
Expand Down
12 changes: 12 additions & 0 deletions Schema/Mysql.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Kanboard\Plugin\TrelloJSON2Kanboard\Schema;

use PDO;

const VERSION = 1;

function version_1(PDO $pdo)
{
$pdo->exec("ALTER TABLE projects ADD COLUMN is_trello_imported TINYINT(1) DEFAULT '0'");
}
12 changes: 12 additions & 0 deletions Schema/Postgres.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Kanboard\Plugin\TrelloJSON2Kanboard\Schema;

use PDO;

const VERSION = 1;

function version_1(PDO $pdo)
{
$pdo->exec("ALTER TABLE projects ADD COLUMN is_trello_imported BOOLEAN DEFAULT '0'");
}
12 changes: 12 additions & 0 deletions Schema/Sqlite.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Kanboard\Plugin\TrelloJSON2Kanboard\Schema;

use PDO;

const VERSION = 1;

function version_1(PDO $pdo)
{
$pdo->exec('ALTER TABLE projects ADD COLUMN is_trello_imported INTEGER DEFAULT "0"');
}

0 comments on commit 53f3b1a

Please sign in to comment.