Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed some misbehaviour in README.md #39

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 28 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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 <repository-url>
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 <ModelName> --attributes <attr1>:<type>,<attr2>:<type>,...
```

### Generating Migrations

- _Generate Migration:_ Generate a new migration file for making changes to the database schema.
bash
npx sequelize-cli migration:generate --name <MigrationName>
```
npx sequelize-cli migration:generate --name <MigrationName>
```

### 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)
Expand Down
Loading