This commit is contained in:
Rizky 2024-07-20 14:30:57 +07:00
parent 0742e2f604
commit 13ff6810ca
1 changed files with 12 additions and 0 deletions

View File

@ -254,6 +254,18 @@ export const execQuery = async (args: DBArg, prisma: any) => {
return getRels({ schema_table, schema, table, tables });
} else if (action === "schema_columns") {
for (const col of schema_table.properties) {
if (
col.type === "attribute" &&
col.name === "id" &&
col.args[0].type === "attributeArgument" &&
col.args[0].value
) {
for (const colname of (col.args[0].value as any).args) {
if (columns[colname]) {
columns[colname].is_pk = true;
}
}
}
if (col.type === "field" && !col.array) {
if (col.attributes && col.attributes?.length > 0) {
const attr = col.attributes.find(