public function init()
{
$parser = TableParser::create($this->connection, $this->driver);
$tables = $parser->getTables();
// if the __meta__table is not found, we should create one to prevent error.
// this will be needed for the compatibility of the older version lazyrecord.
if (!in_array('__meta__', $tables)) {
$schema = new \LazyRecord\Model\MetadataSchema();
$builder = \LazyRecord\SqlBuilder\SqlBuilder::create($this->driver);
$sqls = $builder->build($schema);
foreach ($sqls as $sql) {
$this->connection->query($sql);
}
}
}