mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Clean up handling of table schemas that are marked as deleted in XML
This commit is contained in:
parent
14cb0e7977
commit
f99102ca33
3 changed files with 6 additions and 6 deletions
|
|
@ -782,11 +782,11 @@ class DB
|
|||
$table = Parsers\DBTableParser::loadXML($filename, $content);
|
||||
if (!$table)
|
||||
{
|
||||
return $this->setError(-1, 'Table creation failed.');
|
||||
return $this->setError(-1, 'Failed to load table schema file');
|
||||
}
|
||||
if ($table->deleted)
|
||||
{
|
||||
return new Helpers\DBResultHelper;
|
||||
return new Helpers\DBResultHelper(-1, 'Table is marked as deleted');
|
||||
}
|
||||
|
||||
// Generate the CREATE TABLE query and execute it.
|
||||
|
|
|
|||
|
|
@ -61,10 +61,10 @@ class DBTableParser extends BaseParser
|
|||
$table->name = strval($xml['name']);
|
||||
}
|
||||
|
||||
$deleted = strval($xml['deleted']);
|
||||
if ($deleted !== '')
|
||||
$is_deleted = strval($xml['deleted']);
|
||||
if ($is_deleted !== '')
|
||||
{
|
||||
$table->deleted = toBool($deleted);
|
||||
$table->is_deleted = toBool($is_deleted);
|
||||
}
|
||||
|
||||
// Load columns.
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class Table
|
|||
public $indexes = array();
|
||||
public $primary_key = array();
|
||||
public $constraints = array();
|
||||
public $deleted = false;
|
||||
public $is_deleted = false;
|
||||
|
||||
/**
|
||||
* Generate the CREATE TABLE query for this table.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue