Database Model
To work with the Database model please use MySQL Workbench from here:
The database model is available here: MySQL Workbench Database Model
This model is being automatically published from the development branch.
Updating the database model
In order to update this model we need to take turns into updating it, we cannot merge it from our child branches to the development branch since this a binary file.
When you are making changes to the database model, please inform the group to make sure all of us get those changes. The branch that we will use for this task is: TOPSPIZZA-874/TOPSPIZZA-751
Steps for updating the database model
1) Before making changes, please rebase the development branch into TOPSPIZZA-874/TOPSPIZZA-751
2) Using MySQL Workbench make the necessary changes to the ERR diagram
3) When finished from File->Export->Forward Engineer SQL Create script you will need to generate the SQL script for importing to your database
4) Import the updated model into your database
5) Generate the new migrations using the command:
php artisan migrate:generate --squash
It will generate a single migration file for all tables (useful to keep our codebase clean). The full documentation for this command can be found at: https://github.com/kitloong/laravel-migrations-generator
6) You can then merge this task to the TOPSPIZZA-874/TOPSPIZZA-751 branch and then back to the development branch.
Generating database seeds
Sometimes we will need static data for the database. For this purpose we can use Laravel seeders.
To make things easy we can automatically generate seeders from our database. This command will allow you to pick from what table you would like to make a seeder:
php artisan iseed my_table
The full documentation for this command can be found at:
https://github.com/orangehill/iseed
When generating seeders please inform the group and use the TOPSPIZZA-874/TOPSPIZZA-751 branch for this purpose. Please use the same steps described above to update the branches.