Once you have added your db config as listed above , go to the src folder from your terminal and execute npx sequelixe db:createand then execute npx sequelize db:migrate
DB Design
- Airplane Table
- Flight Table
- Airport Table
- City Table
- A flight belongs to an airplane ,but one airplane can be used in multiple flights
- A city has many airports but one airport belongs to a city
- One airport can have many flights ,but one flight belongs to one airport
Relationship ->City has many airports and an airport belongs to a city(one to many)
Using this command we made Airport models:
npx sequelize model:generate --name Airport --attributes name:String,address:String,cityId:integer
Using this comand we can create seeders(starting inputs) file:
npx sequelize seed:generate --name add-airports
Using this command all seeders file will startgetting seeded
npx sequelize db:seed:all