{"id":15295757,"url":"https://github.com/mohammadhb/sequelize-true-migration","last_synced_at":"2026-01-06T05:03:41.941Z","repository":{"id":143891184,"uuid":"299747684","full_name":"mohammadhb/sequelize-true-migration","owner":"mohammadhb","description":"I am able to form your \"Sql-Based Database\" connected to \"Sequelize\" to look like \"Sequelize Models\" in your \"Sequelize Model Schemes\"","archived":false,"fork":false,"pushed_at":"2020-10-19T16:19:12.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-03T10:47:21.287Z","etag":null,"topics":["mysql","mysql-database","mysqli","node","npm-module","npm-package","orm","orm-extension","orm-framework","orm-library","sequelize","sequelize-extension","sequelize-library","sequelize-migrations","sequelize-models","sequelize-orm","sequelizejs","sql"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mohammadhb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-29T22:00:34.000Z","updated_at":"2021-12-17T13:39:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"b77f9cc9-9ff7-49f4-b254-1ab1a890d684","html_url":"https://github.com/mohammadhb/sequelize-true-migration","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadhb%2Fsequelize-true-migration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadhb%2Fsequelize-true-migration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadhb%2Fsequelize-true-migration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadhb%2Fsequelize-true-migration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohammadhb","download_url":"https://codeload.github.com/mohammadhb/sequelize-true-migration/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245394767,"owners_count":20608123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mysql","mysql-database","mysqli","node","npm-module","npm-package","orm","orm-extension","orm-framework","orm-library","sequelize","sequelize-extension","sequelize-library","sequelize-migrations","sequelize-models","sequelize-orm","sequelizejs","sql"],"created_at":"2024-09-30T18:07:58.402Z","updated_at":"2026-01-06T05:03:36.889Z","avatar_url":"https://github.com/mohammadhb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sequelize True Migration\n\nI am able to form your \"Sql-Based Database\" connected to \"Sequelize\" to look like \"Sequelize Models\" in your \"Sequelize Model Schemes\"\n\n# What is Migration ?\n\n**Migration** is the process of moving from one to another **Form** of **Database**\nSince **Migration** is version-based process and is reversible, our auto-migration system doesn't generate a single version file and do the changing and adding automatically. so you can't call it a migration it self but auto-migration.\n\n# Using \n\n\u003e **Caution :** It's still in Beta phase so don't expect a very clean output although it won't delete or overwrite on your data **Yet**. But in the next updates we will add some features that includes doing this. **Although** it will come with granting your permission by **Options** parameter.\n\n## Getting Started\n\nSuppose you have a object of \"Sequelize\" :\n\n```javascript\n\nconst options = {\n    host   : host,\n    port   : port,\n    dialect: 'mysql',\n    define : {\n        charset: 'utf8',\n        collate: 'utf8_general_ci',\n    }\n};\n\nconst  sequelize = new  Sequelize(tableName, userName, password, options);\n\n```\n\nAdd \"INFORMATION_SCHEMA\" Database as a \"Sequelize\" Object Beside it ( in current runned \"SQL-Based Database System\" instance ) like below:\n\n```javascript\n\nconst options = {\n    host   : host,\n    port   : port,\n    dialect: 'mysql',\n    define : {\n        charset: 'utf8',\n        collate: 'utf8_general_ci',\n    }\n};\n\nconst  sequelize = new  Sequelize(tableName, userName, password, options);\nconst sequelizeInfo = new Sequelize('INFORMATION_SCHEMA', userName, password, options);\n\n```\nAnd then add \"sequelize-true-migration\" package and Create new Object with \"new\" and call \"synchronize\" method for Syncing model with database:\n\n```javascript\nconst SequelizeTrueMigration = require('sequelize-true-migration');\nconst stmObj = new SequelizeTrueMigration(name,sequelize,sequelizeInfo,database,{\n    forceTruncate:false\n})\n\nstmObj.synchronize();\n```\n\n\u003e **Caution :** For getting affected restart your project. probably like this :\n\n### In Runner Systems :\n- Nodemon : On saving files\n- PM2 : \n```sh\n  pm2 restart %Name-Of-Your-Project%\n```\n- Pure Node : \n```sh\n  Ctrl+c ( On running project )\n  node %Main-Project-File%.js\n```\n\nAnd Done. No need to Do Anything.\n\n# Development Progress\n- [x] Main Development\n- [x] Checing Tables and Create a NOT EXIST Table\n- [x] Checing Columns and Create a NOT EXIST Column in Tables\n- [x] Matching Columns and Model Definition and Fix Conflicts ( or Error On Something that needed Developer Attention)\n- [ ] Deleting Undefined Columns that corresponds in Models\n- [ ] Versioning Migrations and Rollback System\n- [ ] Writing Tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohammadhb%2Fsequelize-true-migration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohammadhb%2Fsequelize-true-migration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohammadhb%2Fsequelize-true-migration/lists"}