Add Tenant initialisation service (#2100)

* Add Tenant initialisation service

* few fixes

* fix constraint

* fix tests

* update metadata json with employees and address

* add V2

* remove metadata.gql
This commit is contained in:
Weiko
2023-10-18 18:01:52 +02:00
committed by GitHub
parent 1cd91e60fa
commit 7fbef6d60d
37 changed files with 513 additions and 177 deletions

View File

@ -33,14 +33,6 @@ export const seedWorkspaces = async (prisma: PrismaClient) => {
'80f5e1e3-574a-4bf9-b5bc-98aedd2b76e6', 'workspace_twenty', 'postgres', 'twenty-dev-7ed9d212-1c25-4d02-bf25-6aeccf7ea420'
) ON CONFLICT DO NOTHING`,
);
await prisma.$queryRawUnsafe(`
CREATE TABLE IF NOT EXISTS workspace_twenty.tenant_migrations (
id UUID DEFAULT uuid_generate_v4() PRIMARY KEY,
migrations JSONB,
applied_at TIMESTAMP NULL,
created_at TIMESTAMP DEFAULT NOW()
);
`);
await prisma.$queryRawUnsafe(
'CREATE SCHEMA IF NOT EXISTS workspace_twenty_7icsva0r6s00mpcp6cwg4w4rd',
@ -53,12 +45,4 @@ export const seedWorkspaces = async (prisma: PrismaClient) => {
'b37b2163-7f63-47a9-b1b3-6c7290ca9fb1', 'workspace_twenty_7icsva0r6s00mpcp6cwg4w4rd', 'postgres', 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419'
) ON CONFLICT DO NOTHING`,
);
await prisma.$queryRawUnsafe(`
CREATE TABLE IF NOT EXISTS workspace_twenty_7icsva0r6s00mpcp6cwg4w4rd.tenant_migrations (
id UUID DEFAULT uuid_generate_v4() PRIMARY KEY,
migrations JSONB,
applied_at TIMESTAMP NULL,
created_at TIMESTAMP DEFAULT NOW()
);
`);
};