Error calling a custom postgres view from one database to another
I am in the customization of the relations of a view which is in the postgres “core” database and I wish to add a relation to it towards a view which is in the postgres “gateway” database it tells me that it cannot find the view
Erreur dans l’appel d’une view postgres custom d’une base vers une autre
je suis dans la customisation des relations d’une view qui se trouve dans la database postgres « core » et je souhaite lui ajouter une relation vers une view qui se trouve dans la database postgres « gateway » il me dit qu’il ne trouve pas la view
Observed behavior
===== An exception was raised =====
GET /forest/viewForestSouscription/067740f8-be39-4c1b-b9ad-09dd69e1c118/relationships/viewForestDocumentSignatures?{
timezone: Europe/Paris,
fields[viewForestDocumentSignature]: documentBorrowerExternalId,documentCreationDate,…
fields[viewForestSignatureTransaction]: id,
page[number]: 1,
page[size]: 15,
sort: -id
}
Expected behavior
no error
Failure Logs
===== An exception was raised =====
GET /forest/viewForestSouscription/067740f8-be39-4c1b-b9ad-09dd69e1c118/relationships/viewForestDocumentSignatures?{
timezone: Europe/Paris,
fields[viewForestDocumentSignature]: documentBorrowerExternalId,documentCreationDate,…
fields[viewForestSignatureTransaction]: id,
page[number]: 1,
page[size]: 15,
sort: -id
}
Context
My sequelize view in database postgres core
module.exports = (sequelize, DataTypes) => {
const { Sequelize } = sequelize;
// This section contains the fields of your model, mapped to your table's columns.
// Learn more here: https://docs.forestadmin.com/documentation/v/v6/reference-guide/models/enrich-your-models#declaring-a-new-field-in-a-model
const ViewForestDocumentSignature = sequelize.define('viewForestDocumentSignature', {
id: {
type: DataTypes.INTEGER,
allowNull: false,
primaryKey: true
},
// cut
}, {
tableName: 'view_forest_document_signature',
underscored: true,
timestamps: false,
schema: process.env.DATABASE_SCHEMA,
});
ViewForestDocumentSignature.associate = (models) => {
ViewForestDocumentSignature.hasOne(models.viewForestSignatureTransaction, {
foreignKey: {
name: 'documentSignarureTransactionId'
}
});
};
return ViewForestDocumentSignature;
};
**My sequilize view in database postgres gateway**
module.exports = (sequelize, DataTypes) => {
const { Sequelize } = sequelize;
// This section contains the fields of your model, mapped to your table's columns.
// Learn more here: https://docs.forestadmin.com/documentation/v/v6/reference-guide/models/enrich-your-models#declaring-a-new-field-in-a-model
const ViewForestSignatureTransaction = sequelize.define('viewForestSignatureTransaction', {
id: {
type: DataTypes.INTEGER,
allowNull: false,
primaryKey: true
},
documentSignarureTransactionId: {
type: DataTypes.STRING,
allowNull: false
},
creationDate: {
type: DataTypes.DATE,
allowNull: false
},
terminateDate: {
type: DataTypes.DATE,
allowNull: false
},
viewUrl: {
type: DataTypes.STRING,
},
archivedVolume: {
type: DataTypes.STRING,
},
}, {
tableName: 'view_forest_signature_transaction',
underscored: true,
timestamps: false,
schema: process.env.DATABASE_SCHEMA,
});
ViewForestSignatureTransaction.associate = (models) => {};
return ViewForestSignatureTransaction;
};