Skip to content

Latest commit

 

History

History
82 lines (57 loc) · 1.92 KB

Contributing.md

File metadata and controls

82 lines (57 loc) · 1.92 KB

Contributing

All changes should take place in a separate branch submitted to the master in the form of a pull request.

Steps:

  1. Create a new Branch.
# substitute branchName with whatever suits you
> git checkout -b branchName
  1. After commiting your changes, rebase to make sure you have the latest changes from the master.
> git rebase master
  1. Push your branch to the origin. Git will output a link for creating a pull request, visit this link and create it.
> git push origin branchName
        ...
        ...
remote: Create a pull request for 'branchName' on GitHub by visiting:
remote: https://github.com/zeyad-kay/school-system/pull/branchName/branchName
        ...
        ...
  1. After your changes had been successfully merged into the master branch, your branch will be deleted at the origin but not locally, so make sure you clean up your local.
> git branch -D branchName

Useful commit messages that describe what you have been working on are greatly appreciated, here is a really great guide for writting a helpful commit message.

Developing

Make sure you update the credentials in the /src/db/config/db.js with yours in a .env file.

  1. Install dependencies.
> npm install
  1. Create database.
> npm run db:create
  1. Migrate database.
> npm run db:migrate
  1. Seed database.
> npm run db:seed

To access the database instance, just import the models folder. The models are accessible as properties within the instance. The sequelize instance (ORM) and base class are also accessible as properties.

const db = require("./models");
console.log(Object.keys(db));
// ['Student', 'Father',..., 'sequelize','Sequelize']

If you want to have a clean slate, just run:

# This drops the entire database!
# If you have valuable data don't run it!
> npm run db:clean