Permalink
Browse files

Made the createTable function in Resource less prone to error

Text fields were still getting a default value if set. This is
supposed to be ignored and left at null because of mysql. Although
the fix can be done in the mysql configuration, easier to
take care of it in code.
  • Loading branch information...
Stardog committed Sep 15, 2017
1 parent c96caa3 commit acb1c7f76bd8f892b73fd9112d36f43febe3a107
Showing with 2 additions and 2 deletions.
  1. +1 −1 src-phpws2/src/Resource.php
  2. +1 −1 src-phpws2/src/Variable.php
@@ -267,7 +267,7 @@ public function save()
*/
public function getVariablesAsDatatypes(\phpws2\Database\Table $table)
{
$vars = $this->getVars();
$vars = $this->getSaveVars();
foreach ($vars as $variable) {
if ($variable instanceof \phpws2\Variable) {
if ($variable->getIsTableColumn()) {
@@ -498,7 +498,7 @@ public function loadDataType(\phpws2\Database\Table $table)
}
$dt = $table->addDataType($this->varname, $this->column_type);
if (isset($this->value)) {
if (isset($this->value) && $dt->getDefault() !== null) {
$dt->setDefault($this->toDatabase());
} else {
$dt->setDefault(null);

0 comments on commit acb1c7f

Please sign in to comment.