Web icon indicating copy to clipboard operation
Web copied to clipboard

Schema Manager

Open CrazyHackGUT opened this issue 7 years ago • 0 comments

Schema Manager can help easily create, modify or drop tables. My vision for API:

$DB = \DatabaseManager::GetConnection('SourceBans');
$SM = $DB->getSchemaManager();

// 1st argument - table name
// 2st argument - use table prefix or not
// 3st argument - function
$SM->createTable('vac', true, function (Create $table) {
  $table->addColumn('account_id',  'integer')->unsigned()->primaryKey();
  $table->addColumn('status',      'bool')->setDefault(0);
  $table->addColumn('updated_on',  'integer')->unsigned()->setDefault(0);
});

This should be implemented before we start work on new installer and updater!

CrazyHackGUT avatar Aug 31 '18 09:08 CrazyHackGUT