diff --git a/alter-tenant-id.sh b/alter-tenant-id.sh new file mode 100644 index 0000000..5698e0f --- /dev/null +++ b/alter-tenant-id.sh @@ -0,0 +1,11 @@ +#!/bin/sh +cd packages/db +node -e " +const { Client } = require('pg'); +const url = process.env.DATABASE_URL.replace(/%21/g, '!'); +const c = new Client(url); +c.connect().then(() => c.query('ALTER TABLE users ALTER COLUMN tenantId DROP NOT NULL')) + .then(() => { console.log('tenantId nullable OK'); return c.end(); }) + .catch(e => { console.log('Error:', e.message.substring(0,100)); return c.end(); }); +" +npx tsx prisma/seed.ts diff --git a/src/comment/dto/create-comment.dto.bak b/src/comment/dto/create-comment.dto.bak new file mode 100644 index 0000000..fdc01a5 --- /dev/null +++ b/src/comment/dto/create-comment.dto.bak @@ -0,0 +1,7 @@ +import { IsString, MinLength } from 'class-validator'; + +export class CreateCommentDto { + @IsString() + @MinLength(1) + content!: string; +}