Skip to content

Commit

Permalink
change db field name
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
  • Loading branch information
Julien Veyssier committed Dec 20, 2020
1 parent 958ff5b commit fd636bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/Db/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Project extends Entity {
protected $autoexport;
protected $lastchanged;
protected $guestaccesslevel;
protected $deletion_disabled;
protected $deletiondisabled;
protected $currencyname;

public function __construct() {
Expand All @@ -35,7 +35,7 @@ public function __construct() {
$this->addType('autoexport', 'string');
$this->addType('lastchanged', 'integer');
$this->addType('guestaccesslevel', 'integer');
$this->addType('deletion_disabled', 'integer');
$this->addType('deletiondisabled', 'integer');
$this->addType('currencyname', 'string');
}
}
2 changes: 1 addition & 1 deletion lib/Migration/Version010205Date20201220175819.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
$table = $schema->getTable('cospend_projects');
$table->addColumn('deletion_disabled', 'integer', [
$table->addColumn('deletiondisabled', 'integer', [
'notnull' => true,
'length' => 4,
'default' => 0,
Expand Down
6 changes: 3 additions & 3 deletions lib/Service/ProjectService.php
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ public function getProjectInfo($projectid) {

$qb = $this->dbconnection->getQueryBuilder();

$qb->select('id', 'password', 'name', 'email', 'userid', 'lastchanged', 'guestaccesslevel', 'autoexport', 'currencyname', 'deletion_disabled')
$qb->select('id', 'password', 'name', 'email', 'userid', 'lastchanged', 'guestaccesslevel', 'autoexport', 'currencyname', 'deletiondisabled')
->from('cospend_projects', 'p')
->where(
$qb->expr()->eq('id', $qb->createNamedParameter($projectid, IQueryBuilder::PARAM_STR))
Expand All @@ -626,7 +626,7 @@ public function getProjectInfo($projectid) {
$dbLastchanged = intval($row['lastchanged']);
$dbAutoexport= $row['autoexport'];
$dbCurrencyName = $row['currencyname'];
$dbDeletionDisabled = intval($row['deletion_disabled']) === 1;
$dbDeletionDisabled = intval($row['deletiondisabled']) === 1;
break;
}
$req->closeCursor();
Expand Down Expand Up @@ -1494,7 +1494,7 @@ public function editProject(string $projectid, string $name, ?string $contact_em
$qb->set('autoexport', $qb->createNamedParameter($autoexport, IQueryBuilder::PARAM_STR));
}
if ($deletion_disabled !== null) {
$qb->set('deletion_disabled', $qb->createNamedParameter($deletion_disabled ? 1 : 0, IQueryBuilder::PARAM_INT));
$qb->set('deletiondisabled', $qb->createNamedParameter($deletion_disabled ? 1 : 0, IQueryBuilder::PARAM_INT));
}
if ($currencyname !== null) {
if ($currencyname === '') {
Expand Down

0 comments on commit fd636bc

Please sign in to comment.