Search code examples
database-migrationloopback4

Database migration in loopback4


I wanted to create database tables from model definition in loopback4. How to do that using loopback4's Auto update functionality?


Solution

  • You can use the npm run migrate script in the LoopBack4 application. See https://loopback.io/doc/en/lb4/Database-migrations.html for details. Please note that there is an option to drop existing schemas before creating a new one.