check migration functionality in staging app

This commit is contained in:
prafull-opensignlabs
2023-11-17 18:07:26 +05:30
parent 750e48ca2e
commit 4a3276f4e3
4 changed files with 16 additions and 31 deletions
+2 -2
View File
@@ -132,7 +132,7 @@ async function PDF(s, r) {
: ((a = await axios.get(serverUrl + '/classes/contracts_Users?where=' + m, {
headers: {
'X-Parse-Application-Id': APPID,
'X-Parse-Session-Token': s.headers.sessiontoken,
'X-Parse-Master-Key': masterKEY,
},
})),
'contracts_Users')
@@ -142,7 +142,7 @@ async function PDF(s, r) {
(c = await axios.get(serverUrl + '/classes/contracts_Users?where=' + p, {
headers: {
'X-Parse-Application-Id': APPID,
'X-Parse-Session-Token': s.headers.sessiontoken,
'X-Parse-Master-Key': masterKEY,
},
})).data && 0 < c.data.results.length
? ((a = c), 'contracts_Users')
@@ -32,18 +32,6 @@ exports.up = async Parse => {
});
return schema.update();
// const config = new Config(process.env.APP_ID, process.env.PARSE_MOUNT);
// const schema = await config.database.loadSchema();
// await schema.setPermissions('myclass', {
// get: { requiresAuthentication: true },
// find: { requiresAuthentication: true },
// count: { requiresAuthentication: true },
// create: { requiresAuthentication: true },
// update: { requiresAuthentication: true },
// delete: { requiresAuthentication: true },
// addField: {},
// });
};
/**
+14 -17
View File
@@ -183,24 +183,21 @@ if (!process.env.TESTING) {
httpServer.headersTimeout = 100000; // in milliseconds
httpServer.listen(port, function () {
console.log('parse-server-example running on port ' + port + '.');
const migrate = `APPLICATION_ID=${process.env.APP_ID} SERVER_URL=${process.env.SERVER_URL} MASTER_KEY=${process.env.MASTER_KEY} npx parse-dbtool migrate`;
exec(migrate, (error, stdout, stderr) => {
if (error) {
console.error(`Error: ${error.message}`);
return;
}
if (stderr) {
console.error(`Error: ${stderr}`);
return;
}
console.log(`Command output: ${stdout}`);
});
});
// This will enable the Live Query real-time server
await ParseServer.createLiveQueryServer(httpServer);
const migrate = `APPLICATION_ID=${process.env.APP_ID} SERVER_URL=${process.env.SERVER_URL} MASTER_KEY=${process.env.MASTER_KEY} npx parse-dbtool migrate`;
// 'APPLICATION_ID={legadranaxn} SERVER_URL=http://localhost:8080/app MASTER_KEY=XnAwPDRQQyMr npx parse-dbtool migrate';
exec(migrate, (error, stdout, stderr) => {
if (error) {
console.error(`Error: ${error.message}`);
return;
}
if (stderr) {
console.error(`Error: ${stderr}`);
return;
}
console.log(`Command output: ${stdout}`);
});
}