nxtgauge-backend-rust/crates/db/migrations/20260317000003_init_tutor_schema.up.sql

18 lines
576 B
MySQL
Raw Normal View History

CREATE TABLE IF NOT EXISTS tutor_profiles (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
-- Tutor Specific Fields
subjects_taught TEXT[], -- e.g., ["math", "physics", "computer science"]
education_level VARCHAR(255),
certifications TEXT,
years_of_experience INT,
hourly_rate DECIMAL(10, 2),
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
-- Ensure a user can only have one tutor profile
UNIQUE(user_id)
);