Files
twenty/server/src/database/seeds/metadata.ts
T
1cf08c797f Convert metadata tables to camelCase (#2400)
* Convert metadata tables to camelCase

* datasourcemetadataid to datasourceid

* refactor metadata folders

* fix command

* move commands out of metadata

* fix seed

* rename objectId and fieldId in objectMetadataId and fieldMetadataId in FE

* fix field-metadata

* Fix

* Fix

* remove logs

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2023-11-09 20:06:10 +01:00

16 lines
544 B
TypeScript

import { PrismaClient } from '@prisma/client';
export const seedMetadata = async (prisma: PrismaClient) => {
await prisma.$queryRawUnsafe(
'CREATE SCHEMA IF NOT EXISTS workspace_twenty_7icsva0r6s00mpcp6cwg4w4rd',
);
await prisma.$queryRawUnsafe(
`INSERT INTO metadata."dataSource"(
id, schema, type, "workspaceId"
)
VALUES (
'b37b2163-7f63-47a9-b1b3-6c7290ca9fb1', 'workspace_twenty_7icsva0r6s00mpcp6cwg4w4rd', 'postgres', 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419'
) ON CONFLICT DO NOTHING`,
);
};