Extending the existing data model
Our database model is currently extremely basic. Before we can implement a fully functioning catalog, we need to extend it considerably to store more information about our products. In our fictional phone shop, this includes things such as screen size, battery life, brand, operating system, features, colors, and storage options.
Dropping the existing database
As we're going to be adding quite a few new required fields to the Product
entity, unless we specify default values for these properties, the changes will fail when they hit our existing database. At this point in the development cycle, there is absolutely no harm in dropping and recreating the database as often as is required until we get the structure exactly how we want it. This wouldn't be the case if our application was already live, as we would want to ensure that any changes we make can be successfully applied to an existing database.
Before doing anything else, open a Terminal and run the following...