- Practice running migrations
- Fixing schema errors
- Renaming columns, tables and changing field types
- Fork and Clone
npm install
Ensure our tests run correctly:
npm run test
sequelize db:create
sequelize db:migrate
psql sequelize_migrations_lab_development
\dt
READ ALL THE INSTRUCTIONS BEFORE PERFORMING ANY ACTIONS, DOING OTHERWISE WILL ENSURE THAT YOU HAVE TO START OVER
All operations need to be completed in order! You'll be creating migrations for each step. Run sequelize db:migrate
after each step unless directed otherwise. Check your work often using npm run test
and psql
to check the table names and columns.
-
Businesses has a huge problem, the table is uppercased! Fix the table name to be lowercased and plural. HINT: Look at the
Business
model for the correcttableName
. -
Locations shares the same problem as Businesses, correct the table naming conflict.
If you've completed steps 1 and 2, at this point you can run the provided seed files, sequelize db:seed:all
.
-
The
businesses
tablephoneNmber
column is spelled incorrectly, the column should bephoneNumber
, create a migration to rename the column name. Once the migration is successful, you'll need to make sure to update theBusiness
model. -
The
businesses
table has another problem, thebusinessName
column is redundant, rename this field to justname
. Run your migration and make the necessary modifications in theBusiness
model. Remember thebusinessName
key should reference the newname
column.
At this point you should have 4
passing tests