Add rider/driver role selection after sign-up
- users.role column (+ migration in seed script) - /(api)/user: GET role by clerkId, PATCH to set role - Role selection screen; drivers get placeholder driver-home - Root index routes by role; hardened location handling on home
This commit is contained in:
@@ -26,9 +26,13 @@ await sql`CREATE TABLE IF NOT EXISTS users (
|
||||
name VARCHAR(255) NOT NULL,
|
||||
email VARCHAR(255) NOT NULL,
|
||||
clerk_id VARCHAR(255) NOT NULL,
|
||||
role VARCHAR(20),
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
)`;
|
||||
|
||||
// For databases created before roles existed.
|
||||
await sql`ALTER TABLE users ADD COLUMN IF NOT EXISTS role VARCHAR(20)`;
|
||||
|
||||
await sql`CREATE TABLE IF NOT EXISTS drivers (
|
||||
id SERIAL PRIMARY KEY,
|
||||
first_name VARCHAR(100) NOT NULL,
|
||||
|
||||
Reference in New Issue
Block a user