registerDatabase

With this method in your Event Listener you can define database tables whitch Skynet will create.
You can specify more than one table and specify queries to be executed when Skynet starts and checks required tables in database.
By example, if you want to use table "foo" with fields: "id, bar1, bar2" you will need to register table in method:

public function registerDatabase()
{
/* code here */
}

Example:

/src/SkynetUser/MyListener.php
public function registerDatabase()
{
$queries = [];
$tables = [];
$fields = [];

$queries['foo'] = 'CREATE TABLE foo (id INTEGER PRIMARY KEY AUTOINCREMENT, bar1 VARCHAR (100), bar2 VARCHAR (100))';

$tables['foo'] = 'My Foo table';

$fields['foo'] = [
'id' => 'Description of id Field',
'bar1' => 'Description of bar1 Field',
'bar2' => 'Description of bar2 Field'
];

return array('queries' => $queries, 'tables' => $tables, 'fields' => $fields);
}

Method must returns array with 3 keys:

- queries - whitch stores array with queries to execute if table [key] not exists
- tables - whitch stores array with tables names where TableName => FullName
- fields - whitch stores array with fields descriptions

Queries are executes when Skynet starts and checks tables. If table specified here not exists then queries specified here are executed.
If you want to specify more than one query per table you can specify queries in array:

$queries['foo'] = ['query1', 'query2', 'query3' .....];

Tables created from here will be available in Database View in Skynet Control Panel.
Full API Documentation is included in Skynet packages available on GitHub.