Closed sherif2011 closed 5 years ago
Ok, I think I passed this issue by installing db-migrate-mssql and setting "driver":"mssql". Now I am getting The "config.server" property is required and must be of type string
Please feel free to check my code here.
Yes for each type of db, you will need separate driver of db-migrate and separate connector of loopback as well. A quick glance at your code, I think you need to set server property in database.json. But I really doubt that it will work satisfactorily. From the official docs of db-migrate - https://db-migrate.readthedocs.io/en/latest/#official-supported-databases. Officially it only supports MySql, Postgres, sqlite3, Mongodb. You may have to use some other db-migration library or use loopback migrations.
Some of the other migration libraries that support sql server - Postgrator, node-sql-migrations
For using loopback migrations, refer here - https://loopback.io/doc/en/lb4/Database-migrations.html
Thanks @samarpan-b I will try loopback migrations!
I will stick to postgres for now. Thanks!
Hello, I tried this and it worked great. Now I am trying to get it to work with MS Sql Server. I am stuck with migration and am getting error :ifError got unwanted exception: Connection terminated unexpectedly. I installed "loopback-connector-mssql": "^3.3.0" I modified .env to include connection information
Only thing I have doubts about is the database.json "driver":"pg", should this be changed to something else? What? Also do I need to install sql server migration drivers? to replace "db-migrate-pg" ?
Thanks for advising.
Sherif