Removing Prisma and Grapql-nestjs-prisma resolvers (#2574)
* Some cleaning * Fix seeds * Fix all sign in, sign up flow and apiKey optimistic rendering * Fix
This commit is contained in:
@ -1,32 +0,0 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { getDMMF, getSchemaPath } = require('@prisma/internals');
|
||||
|
||||
const generateTypes = async () => {
|
||||
const schemaPath = await getSchemaPath();
|
||||
const dmmf = await getDMMF({
|
||||
datamodel: fs.readFileSync(schemaPath, 'utf-8'),
|
||||
});
|
||||
|
||||
let content =
|
||||
'// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n';
|
||||
content += "import { Prisma } from '@prisma/client';\n\n";
|
||||
content += 'export type ModelSelectMap = {\n';
|
||||
|
||||
for (const model of dmmf.datamodel.models) {
|
||||
content += ` ${model.name}: Prisma.${model.name}Select;\n`;
|
||||
}
|
||||
|
||||
content += '};\n';
|
||||
|
||||
fs.writeFileSync(
|
||||
path.join(__dirname, '../src/utils/prisma-select/model-select-map.ts'),
|
||||
content,
|
||||
);
|
||||
};
|
||||
|
||||
generateTypes().catch((e) => {
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
});
|
||||
@ -1,5 +1,4 @@
|
||||
#!/bin/sh
|
||||
export PG_DATABASE_URL=postgres://twenty:twenty@$PG_DATABASE_HOST:$PG_DATABASE_PORT/default
|
||||
yarn prisma:migrate
|
||||
yarn database:setup
|
||||
node dist/src/main
|
||||
@ -13,6 +13,10 @@ connectionSource
|
||||
'CREATE SCHEMA IF NOT EXISTS "metadata"',
|
||||
'create schema "metadata"',
|
||||
);
|
||||
await performQuery(
|
||||
'CREATE SCHEMA IF NOT EXISTS "core"',
|
||||
'create schema "core"',
|
||||
);
|
||||
await performQuery(
|
||||
'CREATE EXTENSION IF NOT EXISTS pg_graphql',
|
||||
'create extension pg_graphql',
|
||||
@ -24,7 +28,7 @@ connectionSource
|
||||
);
|
||||
|
||||
await performQuery(
|
||||
`COMMENT ON SCHEMA "public" IS '@graphql({"inflect_names": true})';`,
|
||||
`COMMENT ON SCHEMA "core" IS '@graphql({"inflect_names": true})';`,
|
||||
'inflect names for graphql',
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user