-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappend_sql.js
More file actions
19 lines (17 loc) · 740 Bytes
/
append_sql.js
File metadata and controls
19 lines (17 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const fs = require('fs');
let content = fs.readFileSync('backend/migrations/supabase_migrations.sql', 'utf8');
content += `
-- MVP 8: Bank Mock and Hold Dates
ALTER TABLE payout_schedules
ADD COLUMN IF NOT EXISTS hold_until_date TIMESTAMPTZ,
ADD COLUMN IF NOT EXISTS bank_transaction_ref TEXT;
CREATE TABLE IF NOT EXISTS bank_transactions (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
payout_ref UUID REFERENCES payout_schedules(id),
nestle_account_number TEXT DEFAULT 'NESTLE-CORP-9988',
supplier_account_number TEXT NOT NULL,
amount NUMERIC NOT NULL,
transfer_date TIMESTAMPTZ DEFAULT now(),
status TEXT DEFAULT 'Success'
);`;
fs.writeFileSync('backend/migrations/supabase_migrations.sql', content);