All Projects → MRVMV → sequelize-mig

MRVMV / sequelize-mig

Licence: MIT license
Sequelize migration generator and es6 init tool (Planned)

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to sequelize-mig

seedpress-cms
A headless CMS built in Express for PostgresQL using Sequelize. Generally follows the Wordpress post and term schema.
Stars: ✭ 71 (+31.48%)
Mutual labels:  sequelize, sequelize-cli
koa-orm
koa orm using sequelize & sk2 (fork from knex)
Stars: ✭ 62 (+14.81%)
Mutual labels:  sequelize
nodefony
nodefony core framework
Stars: ✭ 19 (-64.81%)
Mutual labels:  sequelize
Migrate2Postgres
Easily migrate from other DBMSs to PostgreSQL
Stars: ✭ 47 (-12.96%)
Mutual labels:  migration-tool
underbase
MongoDB schema and data migration library based on semver
Stars: ✭ 19 (-64.81%)
Mutual labels:  migration-tool
node-server-template
This is Node.js server tidy template / boilerplate with Express (with asyncified handlers, custom error handler) framework and MongoDb. The server use ES6 and above. On different branches you can see different techniques' and technologies' usage, such as Kafka, nodemailer, file download... You also can find postman collections.
Stars: ✭ 116 (+114.81%)
Mutual labels:  sequelize
sequelize-embed
Easily insert and update sequelize models with deeply nested associations
Stars: ✭ 15 (-72.22%)
Mutual labels:  sequelize
db-migrator.go
DB migrations. CLI and Golang
Stars: ✭ 13 (-75.93%)
Mutual labels:  migration-tool
react-ant-admin-api
专为 react-ant-admin 开发的后端API,完善的权限路由系统,使用 eggjs、ts、mysql开发
Stars: ✭ 52 (-3.7%)
Mutual labels:  sequelize
college-timetable
🗓 프로들의 수강신청 전략 어플리케이션
Stars: ✭ 27 (-50%)
Mutual labels:  sequelize
1702-express-review
Review repo for express.js and sequelize for Fullstack Academy/Grace Hopper Academy 1702 cohort
Stars: ✭ 35 (-35.19%)
Mutual labels:  sequelize
GlaxOJ
An Online-Judge written in Javascript (Nodejs and React).
Stars: ✭ 19 (-64.81%)
Mutual labels:  sequelize
auth-quickstart
Authentication Quickstart with Express, Passport and Sequelize
Stars: ✭ 49 (-9.26%)
Mutual labels:  sequelize
2019-15
Catch My Mind - 웹으로 즐길 수 있는 캐치마인드
Stars: ✭ 19 (-64.81%)
Mutual labels:  sequelize
northwind-demo
Breeze demo with .NET and NodeJS servers and Angular, Aurelia, React, and Vue clients
Stars: ✭ 23 (-57.41%)
Mutual labels:  sequelize
fastexpress
Restful API Framework minimalist
Stars: ✭ 14 (-74.07%)
Mutual labels:  sequelize
passport-local-sequelize
passport-local-sequelize is a sequelize plugin for building username and password login with passport
Stars: ✭ 81 (+50%)
Mutual labels:  sequelize
StackQuest
A multiplayer and team-based action/shooter game.
Stars: ✭ 21 (-61.11%)
Mutual labels:  sequelize
toggl2clockify
Migrate data from toggl to clockify
Stars: ✭ 21 (-61.11%)
Mutual labels:  migration-tool
sync-magento-2-migration
Release of rough proof of concept from 2018 that allows to import and export millions of products quickly
Stars: ✭ 51 (-5.56%)
Mutual labels:  migration-tool

Sequelize migration generator (and es6 init tool) - sequelize-mig

npm node Build Status Snyk Vulnerabilities for GitHub Repo LGTM Grade

semantic-release Contribution-Welcomed Community Chat

Warning: THIS TOOL IS UNDER DEVELOPMENT AND NOT INTENDED TO PRODUCTION USE RIGHT NOW!!!!

The tool is built using es6 And its not intended to replace sequelize-cli its just completing it

This tool provide these commands:

  • migration:make or migration:add - to create new migrations by comparing new version of your modules to old ones
  • migration:undo or migration:revert - delete last migration file and return to backup state file of the models
  • migration:sync - Sync the models schema file with current models without migrating (Planned)

Planned:

  • init - tool to init required files for sequelize using new es6 schema (Planned)

Install

(Globally - Recommended)

npm install sequelize-mig -g / yarn global add sequelize-mig

Or

(devDependencies)

npm install sequelize-mig -D / yarn add sequelize-mig -D

Usage

For New Users

  • Init sequelize, with sequelize-cli, using sequelize init (or using es6 init by sequelize-mig -Planned-)
  • Create your models manually or using sequelize-cli (or using es6 init by sequelize-mig -Planned-)
  • Create initial migration:
sequelize-mig migration:make -n <migration name>
  • To preview new migration, without any changes, you can run:
sequelize-mig migration:make --preview
  • Finally run migration using sequelize-cli sequelize db:migrate
  • You can use --help to view help of the tool or specific command

For Old Users

If you already used migrations before knowing this tool you can easily fully migrate in the sequelize-cli tool and then run migration:sync and tool will update _current.json and you can continue using this tool normally

Limitations

The migration:make tool supports auto detecting these actions

dropTable, removeColumn, removeIndex,
createTable, addColumn, addIndex,
changeColumn

and Im trying to find a way to know old column name to implement renameColumn because it's now translated to removeColumn then addColumn

Explanation

The tool works by getting the schema of the models into _current.json and every time you run migration:make the tool will compare this file with new schema and write the new migration file then this tool cant actually know if you deleted, or migrated or whatever you edited to these files...

Notes

  • You will be able to make index and modules as es6 but keep migration files as es5 because sequelize-cli isn't compatible with it yet.
  • migration:make tool creates _current.json and _current_bak.json files in migrations dir, these are used to calculate difference to the next migration. Do not remove them!
  • Tool create new migration with name {timestamp}_{name}.{js|cjs} but you can change every single option with parameters

TODO

  • Allow init using es6 modules
  • Adding renameColumn in some way I didn't know until now (maybe comments)
  • auto add renameColumn conversion when edits are only to letters case or adding _

Credits

  • Depending on Scimonster/sequelize-auto-migrations which is forked from flexxnn/sequelize-auto-migrations
  • The main projects are not maintained any more
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].