- Add ProjectsClient component for managing projects with a grid and list view. - Introduce project cover image functionality and related fields in the database. - Create a new table for project planning sections with RLS policies for user access. - Update global styles for scrollbar customization. - Enhance Next.js configuration for server actions with increased body size limit. - Document new database migration for project planning assets.
1.8 KiB
0003 - Project Planning Assets
SQL file: supabase/migrations/0003_add_project_planning_assets.sql
Purpose
This migration extends project management beyond task tracking.
It adds:
- Project cover image fields on
projects - A private Supabase Storage bucket for uploaded project images
- A structured
project_planning_sectionstable for project planning categories
Project Image Fields
The projects table receives:
cover_image_path: path of the uploaded file in theproject-assetsbucketcover_image_alt: optional alt text for the cover image
Images are uploaded from the user's computer, not saved as external image links.
Storage Bucket
Bucket:
project-assets
Configuration:
- Private bucket
- Max file size: 5 MB
- Allowed MIME types:
image/jpegimage/pngimage/webpimage/gif
Storage object paths must start with the authenticated user id:
<user_id>/projects/<project_id>/<file_name>
This keeps Storage RLS simple and user-scoped.
Planning Sections
Table:
project_planning_sections
Core fields:
user_idproject_idcategorytitlecontentmetadatasort_order
Allowed categories:
overviewproblemgoalaudiencescopedesign_systemcolor_palettetypographyassetsnotes
RLS
RLS is enabled for project_planning_sections.
Users can only select, insert, update, and delete their own planning sections.
Storage policies allow users to select, upload, update, and delete only files under their own user id folder inside project-assets.
Execution
Run after:
supabase/schema.sqlsupabase/migrations/0002_add_freelancer_os_core_tables.sql
After running this SQL in Supabase, add an execution record to docs/database/query-log.md.