Closed aol-nnov closed 10 years ago
Thank you for the feedback @aol-nnov it will be resolved very soon :beer:
@simov thanks for a quick fix! Any plans to support multiple schemas simultaneously? I have my tables organized across several schemas in postgres.
In this case the schema must be defined per table in settings.json. I'll add your request to my list, and I'll give it a thought. I can't tell you exactly when this will be implemented though.
okay, thanks!
@aol-nnov just pushed to master (still not in npm)
You can specify schema
name for table config like this
"table": {"schema": "name", ...}
In case you want to override the schema name in some of your relation definitions.
"oneToMany": {"schema": "name", ...}
"manyToMany": {"link": {"schema": "name", ...}}
"manyToMany": {"ref": {"schema": "name", ...}}
Keep in mind that specifying schema
key for the whole table does not affect the relationship declarations. In other words you need to specify your desired schema name for each of your relationship declarations.
Hi!
I was trying to use express-admin with postgresql database. My tables are placed in a schema with custom name. After creating initial configuration I saw all my tables from custom schema at http://localhost:3000/ but if I click on any table name or on the plus sign, it spits a small stack trace
After some digging I've managed to enable sql queries logging and found out that schema name is not present in the query:
SELECT "vendor"."id" AS __pk,"vendor"."name","vendor"."id" FROM "vendor" WHERE "id"=null ;
As a quick test I've hacked into utils/query.js and hardcoded schema name into queries, which proved the root cause of the issue - the aforementioned error disappeared.
Unfortunately, I do not have much free time now to wrap my head around the express-admin sources to contribute a fix, but I'd be glad if this issue would be resolved soon.
Thanks in advance, Andrey