From c530042dc9282c4449dee088e4dd8ec2716b51ff Mon Sep 17 00:00:00 2001 From: favor-star Date: Mon, 29 Apr 2024 09:16:01 +0200 Subject: [PATCH] Fixed some misbehaviour in README.md --- README.md | 47 ++++++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 93ff4255..78c4122e 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ Being able to access the e-commerce-mavericcks-bn backe-end: 2. Installing depedencies: -`npm install ` +`npm install` 3. Copy the environment configuration: @@ -157,58 +157,67 @@ This documentation provides guidance on setting up and using Sequelize in the pr ## Setup -1. _Clone the Repository:_ Clone the project repository to your local machine. - bash - git clone -2. _Install Dependencies:_ Install the project dependencies using npm. - bash - npm install -3. _Run Migrations:_ Execute existing migrations to create database tables. - bash +1. _Run Existing Migrations:_ Execute existing migrations to create database tables. + + ``` npm run migrate + ``` ## Usage ### Running Migrations - _Create Tables:_ To create database tables based on existing migrations. - bash + + ``` npm run migrate + ``` + - _Undo Changes:_ If you need to rollback changes made by migrations. - bash - npm run migrate:undo + ``` + npm run migrate:undo + ``` ### Seeding Data - _Seed Database:_ Add initial data to the database. - bash + ``` npm run seed + ``` + - _Undo Seeding:_ Remove seeded data from the database. - bash - npm run seed:undo + + ``` + npm run seed:undo + ``` ### Creating Models - _Generate Model:_ Create a new model using the Sequelize CLI. - bash + + ``` npx sequelize-cli model:generate --name --attributes :,:,... + ``` ### Generating Migrations - _Generate Migration:_ Generate a new migration file for making changes to the database schema. - bash - npx sequelize-cli migration:generate --name + ``` + npx sequelize-cli migration:generate --name + ``` ### Executing Migrations - _Run Migrations:_ Execute the generated migration to apply changes to the database. - bash + ``` npm run migrate + ``` ## Conclusion Sequelize simplifies database interactions in the project by providing an ORM layer. Follow the steps outlined above to set up Sequelize and manage database schema changes effectively. For more information, refer to the Sequelize documentation. + ## Useful Links 1. [Pivotal Tracker's Official Documentation](https://www.pivotaltracker.com/help/articles/github_integration/#attaching-branches-to-a-story-automatically)