Skip to content

feat(db): initialize Supabase project structure and core database migrations #5

Open

Description

@Icedmist

Summary

Establish the Supabase project configuration and initial database migrations for core ProblemSpot entities with Row Level Security (RLS) policies as specified in docs/ARCHITECTURE.md (Section 5).

Scope

  1. Initialize supabase/ structure:
    • supabase/config.toml
    • supabase/migrations/
    • supabase/seed.sql
  2. Create initial migration for core tables:
    • profiles (id, email, username, display_name, avatar_url, github_username, role, is_public)
    • categories (id, name, slug, description, icon)
    • problems (id, title, description, category_id, creator_id, location_name, status, created_at)
    • problem_votes (id, problem_id, user_id, vote_type: personal_confirmation | community_support) with unique constraint on (problem_id, user_id, vote_type)
    • evidence (id, problem_id, user_id, file_url, file_type, description, is_sensitive)
    • problem_status_history (id, problem_id, changed_by, old_status, new_status, reason)
  3. Implement Row Level Security (RLS) policies for each table.

Acceptance Criteria

  • Migrations apply cleanly.
  • Database-level unique constraint prevents duplicate voting.
  • RLS policies enforce authenticated writes and public read access where appropriate.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions