12 lines
428 B
Bash
12 lines
428 B
Bash
#!/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
|