Code Monkey home page Code Monkey logo

gina's Introduction

Gina

Gina is a tool to auto-generate and run migrations based on Sequelize ORM.

How to use it

Install

You can install this using:

npm install gina-sequelize

You'll need to install it globally so you can you the gina-cli

npm install -g gina-sequelize
# make sure to install ts-node too:
npm install -g ts-node

Initialize Gina

If this is the first time you are running Gina on your project you'll need to initialize it.

gina-cli init

This will generate a folder gina to your project. Inside this folder you will find the file initializeModels.ts. You will need to modify this file so that the initializeModels method inside it return a valid sequelize instance object that has all your models ALREADY loaded.

Upgrade database

Once you have the initializeModels configured you can upgrade your database using:

gina-cli upgrade

Generating new migration

Once you have the initializeModels configured you can generate auto migrations. It'll compare your loaded models with the database that you are connected. All differences should be listed on a new migration file that will be placed inside the folder gina/migrations.

gina-cli generate-migration "Creating user table"

Development

If you want to edit the cli and test it you can install it locally:

npm install -g .

gina's People

Contributors

ezequielramos avatar

Stargazers

João Victor Canabarro avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.