Express and Sequelize (MySQL)
- Make two tables
users
andshops
via migrations in the database. users
table must containname
,email
,password
(must be hashed),role
(ENUM type havingUser
,Admin
values),createdAt
andupdatedAt
fields.- While
shops
table must containname
,description
,fk_user_id
(foreign key ofusers
table),address
,createdAt
, andupdatedAt
fields. - There should be one to many relationship between
users
andshops
.i.e. one user can have multiple shops.