loopback icon indicating copy to clipboard operation
loopback copied to clipboard

issue with using-built-in-models with postgresql

Open cyclopsnet opened this issue 8 years ago • 3 comments

I wanted to create the models ['User', 'AccessToken', 'ACL', 'RoleMapping', 'Role'] using the code :

var server = require('./server');
var ds = server.dataSources.mydb;
var lbTables = ['User', 'AccessToken', 'ACL', 'RoleMapping', 'Role'];
ds.autoupdate(lbTables, function(er) {
  if (er) throw er;
  console.log('Loopback tables [' - lbTables - '] created in ', ds.adapter.name);
  ds.disconnect();
});

But i have the following error "right refused for the dev database". When I have checked the database logs; loopback tries to create a "public" schema. How can I specify the schema in which it should create these tables?

My datasource :

"mydb": {
    "name": "mydb",
    "connector": "postgresql",
    "schema": "web_bus",
    "database": "dev",
    "host": "host",
    "port": 5432,
    "user": "web_bus",
    "password": "web_bus",
    "username": "web_bus",
    "debug": true
  }

cyclopsnet avatar Oct 29 '18 09:10 cyclopsnet

I have the same question. Maybe you can use the user name which is same as schema's name.

c0derGitHub avatar Mar 14 '19 07:03 c0derGitHub

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 17 '19 21:09 stale[bot]

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

stale[bot] avatar Oct 01 '19 22:10 stale[bot]