|
@@ -348,12 +348,12 @@ if (!class_exists('schema')) {
|
|
|
|
|
|
//database create table
|
|
//database create table
|
|
public function db_create_table ($apps, $db_type, $table) {
|
|
public function db_create_table ($apps, $db_type, $table) {
|
|
- foreach ($apps as $x => &$app) {
|
|
|
|
- foreach ($app['db'] as $y => $row) {
|
|
|
|
|
|
+ if (is_array($apps)) foreach ($apps as $x => &$app) {
|
|
|
|
+ if (is_array($app['db']) foreach ($app['db'] as $y => $row) {
|
|
if ($row['table'] == $table) {
|
|
if ($row['table'] == $table) {
|
|
$sql = "CREATE TABLE " . $row['table'] . " (\n";
|
|
$sql = "CREATE TABLE " . $row['table'] . " (\n";
|
|
$field_count = 0;
|
|
$field_count = 0;
|
|
- foreach ($row['fields'] as $field) {
|
|
|
|
|
|
+ if (is_array($row['fields']) foreach ($row['fields'] as $field) {
|
|
if ($field['deprecated'] == "true") {
|
|
if ($field['deprecated'] == "true") {
|
|
//skip this row
|
|
//skip this row
|
|
}
|
|
}
|
|
@@ -887,3 +887,5 @@ if (!class_exists('schema')) {
|
|
//$obj->schema();
|
|
//$obj->schema();
|
|
//$result_array = $schema->obj['sql'];
|
|
//$result_array = $schema->obj['sql'];
|
|
//print_r($result_array);
|
|
//print_r($result_array);
|
|
|
|
+
|
|
|
|
+?>
|