AI Resource Pro / website / MIGRATION-INSTRUCTIONS.md
Image URL Migration Instructions
This document provides instructions for adding the image_url column to the tools table in the Supabase database.
Background
The application now supports separate icon and main image uploads for tools:
icon_url: Small icon for tools (already in database schema)image_url: Main image for tools (needs to be added)
Steps to Apply Migration
- Make sure you have the latest code:
```bash
git pull
``` - Install dependencies:
```bash
npm install
``` - Run the migration script:
```bash
npm run supabase:add-image-url
``` - Restart your application:
```bash
npm run dev
```
What the Migration Does
- Adds an
image_urlcolumn to thetoolstable - Ensures the
icon_urlcolumn exists (as a fallback) - Refreshes the schema cache to ensure the new columns are recognized by Supabase
Troubleshooting
If you encounter any issues:
- Check if the migration applied correctly:
```sql
SELECT column_name FROM information_schema.columns WHERE table_name = 'tools' AND column_name IN ('icon_url', 'image_url');
``` - If the columns exist but are not being recognized, try manually refreshing the schema cache:
```sql
SELECT pg_reload_conf();
``` - If all else fails, you can manually add the columns:
```sql
ALTER TABLE public.tools ADD COLUMN IF NOT EXISTS icon_url TEXT;
ALTER TABLE public.tools ADD COLUMN IF NOT EXISTS image_url TEXT;
```