Good — Supabase is connected. Now let me try the migration on the new project directly:
The Supabase integration was added manually (not through Vercel Marketplace), so the migration tool can't auto-connect. Since you mentioned a VPS database, here is a complete guide to set everything up yourself — this will work 100% independently without Supabase.
SSH into your VPS and run:
sudo apt update
sudo apt install -y postgresql postgresql-contrib
sudo systemctl start postgresql
sudo systemctl enable postgresqlsudo -u postgres psqlInside psql:
CREATE USER praymid_user WITH PASSWORD 'YourStrongPassword123!';
CREATE DATABASE praymid_db OWNER praymid_user;
GRANT ALL PRIVILEGES ON DATABASE praymid_db TO praymid_user;
\qEdit PostgreSQL config:
sudo nano /etc/postgresql/*/main/postgresql.confChange: listen_addresses = 'localhost' → listen_addresses = '*'
Then edit pg_hba.conf:
sudo nano /etc/postgresql/*/main/pg_hba.confAdd at the bottom:
host all all 0.0.0.0/0 md5Restart PostgreSQL:
sudo systemctl restart postgresqlOpen firewall port:
sudo ufw allow 5432/tcpConnect to your DB:
psql -U praymid_user -d praymid_db -h localhostThen paste this entire SQL:
-- 1. PARTICIPANTS
CREATE TABLE IF NOT EXISTS participants (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
serial_number SERIAL UNIQUE,
full_name TEXT NOT NULL,
username TEXT UNIQUE NOT NULL,
email TEXT UNIQUE NOT NULL,
mobile_number TEXT UNIQUE,
password TEXT NOT NULL,
plain_password TEXT,
wallet_address TEXT,
bep20_address TEXT,
country TEXT DEFAULT '',
country_code TEXT DEFAULT '',
state TEXT DEFAULT '',
pin_code TEXT DEFAULT '',
full_address TEXT DEFAULT '',
status TEXT DEFAULT 'active',
rank TEXT DEFAULT 'bronze',
referral_code TEXT UNIQUE,
referred_by TEXT,
total_referrals INTEGER DEFAULT 0,
total_earnings NUMERIC DEFAULT 0,
account_balance NUMERIC DEFAULT 0,
bonus_balance NUMERIC DEFAULT 0,
is_active BOOLEAN DEFAULT TRUE,
is_frozen BOOLEAN DEFAULT FALSE,
details_completed BOOLEAN DEFAULT FALSE,
activation_date TIMESTAMPTZ,
last_login TIMESTAMPTZ,
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW()
);
-- 2. MOBILE OTPs
CREATE TABLE IF NOT EXISTS mobile_verification_otps (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
mobile_number TEXT NOT NULL,
otp_code TEXT NOT NULL,
email TEXT NOT NULL,
is_verified BOOLEAN DEFAULT FALSE,
attempt_count INTEGER DEFAULT 0,
verified_at TIMESTAMPTZ,
expires_at TIMESTAMPTZ NOT NULL,
created_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_otp_mobile ON mobile_verification_otps(mobile_number);
-- 3. PAYMENT SUBMISSIONS
CREATE TABLE IF NOT EXISTS payment_submissions (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
participant_id UUID REFERENCES participants(id) ON DELETE SET NULL,
participant_email TEXT NOT NULL,
amount NUMERIC NOT NULL DEFAULT 100,
payment_method TEXT DEFAULT 'USDT_BEP20',
screenshot_url TEXT,
transaction_id TEXT UNIQUE,
status TEXT DEFAULT 'pending',
matched_payout_id UUID,
matched_at TIMESTAMPTZ,
admin_notes TEXT,
reviewed_at TIMESTAMPTZ,
reviewed_by TEXT,
rejection_reason TEXT,
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_ps_participant ON payment_submissions(participant_id);
CREATE INDEX IF NOT EXISTS idx_ps_email ON payment_submissions(participant_email);
CREATE INDEX IF NOT EXISTS idx_ps_status ON payment_submissions(status);
-- 4. PAYOUT REQUESTS
CREATE TABLE IF NOT EXISTS payout_requests (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
participant_id UUID REFERENCES participants(id) ON DELETE SET NULL,
participant_email TEXT NOT NULL,
wallet_address TEXT NOT NULL,
amount NUMERIC NOT NULL,
payout_method TEXT DEFAULT 'BEP20',
status TEXT DEFAULT 'pending',
transaction_hash TEXT,
admin_notes TEXT,
processed_at TIMESTAMPTZ,
processed_by TEXT,
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_pr_participant ON payout_requests(participant_id);
CREATE INDEX IF NOT EXISTS idx_pr_email ON payout_requests(participant_email);
CREATE INDEX IF NOT EXISTS idx_pr_status ON payout_requests(status);
ALTER TABLE payment_submissions
ADD CONSTRAINT fk_ps_matched_payout
FOREIGN KEY (matched_payout_id) REFERENCES payout_requests(id) ON DELETE SET NULL;
-- 5. TRANSACTIONS
CREATE TABLE IF NOT EXISTS transactions (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
participant_id UUID REFERENCES participants(id) ON DELETE SET NULL,
participant_email TEXT,
type TEXT NOT NULL,
amount NUMERIC NOT NULL,
description TEXT,
reference_id UUID,
status TEXT DEFAULT 'completed',
balance_before NUMERIC,
balance_after NUMERIC,
created_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_tx_participant ON transactions(participant_id);
CREATE INDEX IF NOT EXISTS idx_tx_type ON transactions(type);
-- 6. PREDICTIONS
CREATE TABLE IF NOT EXISTS predictions (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
participant_id UUID REFERENCES participants(id) ON DELETE SET NULL,
participant_email TEXT NOT NULL,
crypto_pair TEXT NOT NULL,
prediction_type TEXT NOT NULL,
amount NUMERIC NOT NULL,
entry_price NUMERIC NOT NULL,
target_price NUMERIC,
leverage INTEGER DEFAULT 1,
profit_loss NUMERIC DEFAULT 0,
result TEXT,
status TEXT DEFAULT 'pending',
closed_at TIMESTAMPTZ,
created_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_pred_participant ON predictions(participant_id);
CREATE INDEX IF NOT EXISTS idx_pred_email ON predictions(participant_email);
CREATE INDEX IF NOT EXISTS idx_pred_status ON predictions(status);
-- 7. TOPUP REQUESTS
CREATE TABLE IF NOT EXISTS topup_requests (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
participant_id UUID REFERENCES participants(id) ON DELETE SET NULL,
participant_email TEXT NOT NULL,
amount NUMERIC NOT NULL,
payment_method TEXT DEFAULT 'crypto',
transaction_id TEXT UNIQUE,
status TEXT DEFAULT 'pending',
admin_notes TEXT,
reviewed_at TIMESTAMPTZ,
reviewed_by TEXT,
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_topup_participant ON topup_requests(participant_id);
CREATE INDEX IF NOT EXISTS idx_topup_email ON topup_requests(participant_email);
-- 8. NOTIFICATIONS
CREATE TABLE IF NOT EXISTS notifications (
id UUID PRIMARY KEY DEFAULT gen_
<AssistantMessageContentPart partEncoded="eyJjcmVhdGVkQXQiOjE3NzcwNjUzMTY0NjcsImZpbmlzaGVkQXQiOjE3NzcwNjUzMTY0NjcsImxhc3RQYXJ0U2VudEF0IjoxNzc3MDY1MzE2NDY3LCJpZCI6ImNKWGV4bVJIdUlER3hqeEwiLCJ0eXBlIjoidGFzay1zdG9wcGVkLXYxIiwicGFydHMiOlt7InR5cGUiOiJtYW51YWxseS1zdG9wcGVkLW9uLWNsaWVudCJ9XX0=" />
The complete guide has been saved to VPS_DATABASE_SETUP_GUIDE.md in your project. Here's a quick summary of the 8 parts:
praymid_user and database praymid_dbPOSTGRES_URL to v0 Settings → VarsOnce all steps are done, just tell me and I'll update the app code to use your VPS database connection directly.
You can send messages while the preview loads