-
Notifications
You must be signed in to change notification settings - Fork 0
12. Dev.Setup
Simon Striekwold edited this page Mar 29, 2018
·
3 revisions
The setup functionality automatically creates your database and loads it with test data. If the database already exists it resets the database and loads it with clean test data.
- Make sure
Debug
is set to true in the config. - Go to the URL
/dev/setup
, and clickReset database
.
In the database_struct.php
file add a new first level array entry to add a new table, and add an array entry in a table entry to add a column. The key of a column entry is the name of the column and the value is the datatype and length. To findout what you can enter here, go to the structure tab in your phpmyadmin, and see the type
of the column.
To add a primary key, add an array entry in the primaryKeys
array. The key is the table and the value is the column.
public static function getStructure() {
return [
'user' => [
'id' => 'varchar(256)',
'name' => 'varchar(256)'
],
'primaryKeys' => [
'user' => 'id'
]
];
}
Add generating code to the getData
function.
public static function getData() {...}