mirror of
http://forgejo-oa09toasww4dgii9cj3gpzda.187.127.164.61.sslip.io/iamcoolvivek007/bharath.git
synced 2026-06-11 00:06:51 +00:00
- Govt-app styled freight marketplace - Role-based auth (driver/shipper/broker/admin) - Load board with bidding system - Trip tracking with status flow - In-app messaging - Admin panel - Mobile bottom nav + PWA - Docker + Coolify ready
30 lines
1.1 KiB
SQL
30 lines
1.1 KiB
SQL
-- ============================================================
|
|
-- BharathTrucks — App Users Migration (Username + Password)
|
|
-- Run in Supabase SQL Editor
|
|
-- ============================================================
|
|
|
|
CREATE TABLE IF NOT EXISTS app_users (
|
|
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
|
|
username TEXT UNIQUE NOT NULL,
|
|
name TEXT NOT NULL,
|
|
password_hash TEXT NOT NULL,
|
|
role TEXT NOT NULL CHECK (role IN ('driver', 'shipper', 'broker', 'admin')),
|
|
phone TEXT,
|
|
city TEXT,
|
|
state TEXT,
|
|
is_verified BOOLEAN DEFAULT FALSE,
|
|
is_premium BOOLEAN DEFAULT FALSE,
|
|
is_active BOOLEAN DEFAULT TRUE,
|
|
created_at TIMESTAMPTZ DEFAULT NOW()
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_app_users_role ON app_users(role);
|
|
CREATE INDEX IF NOT EXISTS idx_app_users_username ON app_users(username);
|
|
|
|
-- RLS
|
|
ALTER TABLE app_users ENABLE ROW LEVEL SECURITY;
|
|
CREATE POLICY "Allow all on app_users" ON app_users FOR ALL USING (true) WITH CHECK (true);
|
|
|
|
-- ============================================================
|
|
-- Done! No Supabase Auth needed — app manages its own users.
|
|
-- ============================================================
|