How to get Nuxeo to update the DDL of the users table when adding new fields ?

Hi everybody!, I'm attempting to add a new property to the user profile. I followed the documentation # Add New Fields to the User Profile or Group Profile and made the required changes in nuxeo studio, then, I performed a hot reload, and restarted the nuxeo server, but nuxeo did not create the new property in the database automatically, and I discovered the following error in the “nuxeo-error.log” file:

Caused by: org.postgresql.util.PSQLException: ERROR: column "community" does not exist
  Position: 19
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2285)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:323)
    at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:473)
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:393)
    at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:164)
    at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:114)
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:122)
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:122)
    at org.nuxeo.ecm.directory.sql.SQLSession.getEntryFromSource(SQLSession.java:133)

to solve the problem, I had to update the user table ddl myself with the following sql request:

ALTER TABLE users ADD community varchar(255);

So, my question is, is there an option to put in the nuxeo.conf file so that nuxeo updates the ddl (Data Definition Language) if the schema of an entity has been changed ?

0 votes

1 answers

734 views

ANSWER

It seems to me like the contribution may not be hooked up properly. Any errors in the server.log when the server starts?
04/28/2021

Yes in the server.log file, I found the same error message.
04/30/2021



Hello Belgacem,

If you've followed the documentation page, it should work without doing any kind of operation on the underlying database, being Postgres, Mongo or any other. So I guess this should be probably a bug related to Postgres, it would be great if someone else can reproduce it (I'm not aware of it).

Thx

0 votes



I deployed my studio project on two nuxeo LTS 2021 instances, and when I restarted and tried to login to nuxeo, it crashes telling me that the column "community" does not exist. I had the same error for my two instances nuxeo lts 2021. But when I deployed my project on a nuxeo LTS 2019 instance, nuxeo automatically created the column for me and everything is fine. The PostgreSQL version used is 12.6.
04/30/2021