Defining models for a database
In this section, we will go over a brief overview of our project’s requirements and establish which kinds of models we need to define. After that, we will run a script generator command from the Sequelize command-line interface (CLI) tool and inspect the basic structure of a model’s definition.
For Avalon Airlines, we will begin modeling with the following organizations and things:
- Airplanes
- Customers
- Flight schedules
- Boarding tickets
Each model will have its own table within the database. We will eventually associate these models or tables with columns, indices, validation, and relations to other models. For now, we will define, select (or query), insert, update, and delete data from these tables using Sequelize within our Node.js application. If you are working on a pre-existing project that already has a database, the Manipulating and querying data using Sequelize section will pertain to you more than to...