{"id":22008923,"url":"https://github.com/letsfullstack/loopback-auto-migrate-component","last_synced_at":"2026-04-15T05:31:23.197Z","repository":{"id":91552424,"uuid":"268083465","full_name":"letsfullstack/loopback-auto-migrate-component","owner":"letsfullstack","description":"Forked mixin to automigrate models on Loopback.","archived":false,"fork":false,"pushed_at":"2020-06-04T23:03:46.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-09-08T16:54:34.097Z","etag":null,"topics":["coffeescript","eslint","loopback","loopback-component"],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","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/letsfullstack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","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-05-30T13:18:57.000Z","updated_at":"2020-06-04T23:05:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"42dd61d1-a2c8-4d26-93ee-24cd09c6161e","html_url":"https://github.com/letsfullstack/loopback-auto-migrate-component","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/letsfullstack/loopback-auto-migrate-component","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsfullstack%2Floopback-auto-migrate-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsfullstack%2Floopback-auto-migrate-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsfullstack%2Floopback-auto-migrate-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsfullstack%2Floopback-auto-migrate-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/letsfullstack","download_url":"https://codeload.github.com/letsfullstack/loopback-auto-migrate-component/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsfullstack%2Floopback-auto-migrate-component/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31828530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"online","status_checked_at":"2026-04-15T02:00:06.175Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["coffeescript","eslint","loopback","loopback-component"],"created_at":"2024-11-30T02:07:45.879Z","updated_at":"2026-04-15T05:31:23.185Z","avatar_url":"https://github.com/letsfullstack.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Publish Github Package](https://github.com/letsfullstack/loopback-auto-migrate-component/workflows/Publish%20Github%20Package/badge.svg)\n\n# AutoMigrate from Boot Loopback Component\n\nThis loopback component enables you to migrate the database and import datas automatcally for the loopback application.\n\nOriginal Author: Riceball Lee\n\nNode version used for development: **v10.13.0**\n\n## Contributing\n\n:boom: In case you are making a commit for this package repository, **MAKE SURE TO READ AND UNDERSTAND THE FOLLOWING TOPICS**:\n\n1\\. Every commit that runs on the [master branch](https://github.com/letsfullstack/loopback-auto-migrate-component/tree/master) runs through the Publish Github Package Workflow on Github Actions. So **be sure to check if your code is well written and tested**, since it'll be published if the code passes the Continuous Integration (CI) unit tests.\n\n2\\. If the commit passes through the Github Actions workflow, the module will be released as a package in the Github Packages Registry. This workflow has an [underlying command](https://github.com/phips28/gh-action-bump-version) that **increments/bumps the version from the latest release based on commit messages**, such as:\n\n- If the string \"BREAKING CHANGE\" or \"major\" is found anywhere in any of the commit messages or descriptions, the **major version** will be incremented (i.e. 1.X.X).\n\n- If a commit message begins with the string \"feat\" or includes \"minor\" then the **minor version** will be increased (i.e. X.1.X). This works for most common commit metadata for feature additions: \"feat: new API\" and \"feature: new API\".\n\n- All other changes will increment the **patch version** (i.e. X.X.1).\n\n3\\. Furthermore, the workflow has also an underlying command that deploys automatically a new release when a success test/deployment takes places. These releases can be found [here](https://github.com/letsfullstack/loopback-auto-migrate-component/releases).\n\n## Installation\n\n1. Install in you loopback project:\n\n```shell\n$ npm install @letsfullstack/loopback-automigrate-component\n```\n\n2. Create a component-config.json file in your server folder (if you don't already have one)\n\n3. Configure options inside `component-config.json`:\n\n  ```json\n  {\n    \"loopback-component-auto-migrate\": {\n      \"enabled\": true,\n      \"raiseError\": false,\n      \"migration\": \"auto-migrate-data\",\n      \"models\": [\"Role\"],\n      \"fixtures\": \"./test/fixtures/\"\n    }\n  }\n  ```\n  - `enabled` *[Boolean]*: whether enable this component. *defaults: true*\n  - `raiseError` *[Boolean]*: whether raise error. *defaults: false*\n    * it wont stop to import data if not raise error.\n  - `migration` *[String]* : the migration ways:\n    * \"auto-migrate\": drop and recreate the tables of the database.\n    * \"auto-migrate-data\": drop and recreate the tables, load datas from `fixtures` folder.\n    * \"auto-update\" *defaults*: update the tables of the databse.\n    * \"auto-update-data\": update the tables, load datas from `fixtures` folder.\n    * \"auto-load-data\": load datas from `fixtures` folder.\n  - `models` *[array of String]*: the models to process. *defaults to the all models in the model-config.json*\n    * a JSON file location can be used instead of passing all list inside *component-config.json*: `\"./test/models/model-list.json\"`\n  - `fixtures` *[String]*: the datas folder to import.\n    * the file base name is the lowercase model name with dash seperated if any.\n    * the file extension name is the data file format, the following format is supported:\n      * cson\n      * yaml\n      * json\n\n## Usage\n\n### Automatically use it:\n\nJust enable it on `component-config.json`.\n\nor run `node_modules/.bin/slc-migrate` directly.\n\nset `DEBUG=loopback:component:autoMigrate:*` env variable to show debug info.\n\nWhen it runs through `component-config.json`, it is attaching the `autoMigrate` promise at `app.get('loopback-component-auto-migrate-done')` that you can use to know when all migrations, data importing etc have finished.\n\nAlso the `loopback-component-auto-migrate-status` will be set for convenience:\n\n  * 'loaded': autoMigrate loaded.\n  * 'failed': autoMigrate failed.\n  * 'done': autoMigrate successful.\n\n### Manually use it:\n\n```js\nautoMigrate = require('loopback-component-auto-migrate/lib/auto-migrate');\nautoMigrate(app, {models:['Role'], fixtures: 'yourDataFolder'}).then()\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletsfullstack%2Floopback-auto-migrate-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fletsfullstack%2Floopback-auto-migrate-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletsfullstack%2Floopback-auto-migrate-component/lists"}