Migrate standard objects (#2439)
* Migrate standard objects * Add migrations * fix relation * fix: register RelationMetadataType enum * fix: correctly fix null relation --------- Co-authored-by: corentin <corentin@twenty.com> Co-authored-by: Jérémy Magrin <jeremy.magrin@gmail.com>
This commit is contained in:
@ -1,15 +1,19 @@
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
|
||||
export const SeedDataSourceId = '20202020-7f63-47a9-b1b3-6c7290ca9fb1';
|
||||
export const SeedWorkspaceId = '20202020-1c25-4d02-bf25-6aeccf7ea419';
|
||||
export const SeedWorkspaceSchemaName = 'workspace_1wgvd1injqtife6y4rvfbu3h5';
|
||||
|
||||
export const seedMetadata = async (prisma: PrismaClient) => {
|
||||
await prisma.$queryRawUnsafe(
|
||||
'CREATE SCHEMA IF NOT EXISTS workspace_twenty_7icsva0r6s00mpcp6cwg4w4rd',
|
||||
`CREATE SCHEMA IF NOT EXISTS ${SeedWorkspaceSchemaName}`,
|
||||
);
|
||||
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'
|
||||
'${SeedDataSourceId}', '${SeedWorkspaceSchemaName}', 'postgres', '${SeedWorkspaceId}'
|
||||
) ON CONFLICT DO NOTHING`,
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user