build_table() public method

public build_table ( $table_name, $fields_to_add, $use_cache = false )
Example #1
0
 public function createSchema()
 {
     if (!DbSchema::hasTable('sessions')) {
         try {
             DbSchema::create('sessions', function ($table) {
                 $table->string('id')->unique();
                 $table->longText('payload');
                 $table->integer('last_activity');
             });
         } catch (QueryException $e) {
         }
     }
     $exec = $this->getSystemSchemas();
     $builder = new DbUtils();
     foreach ($exec as $data) {
         // Creates the schema
         if (!method_exists($data, 'get')) {
             break;
         }
         $schemaArray = $data->get();
         if (!is_array($schemaArray)) {
             break;
         }
         foreach ($schemaArray as $table => $columns) {
             $builder->build_table($table, $columns);
         }
     }
 }