21 lines
516 B
SQL
21 lines
516 B
SQL
# Database Migration: Add Image Support
|
|
|
|
Run these SQL commands on your PostgreSQL database:
|
|
|
|
```sql
|
|
-- Add image columns to grocery_list table
|
|
ALTER TABLE grocery_list
|
|
ADD COLUMN item_image BYTEA,
|
|
ADD COLUMN image_mime_type VARCHAR(50);
|
|
|
|
-- Optional: Add index for faster queries when filtering by items with images
|
|
CREATE INDEX idx_grocery_list_has_image ON grocery_list ((item_image IS NOT NULL));
|
|
```
|
|
|
|
## To Verify:
|
|
```sql
|
|
\d grocery_list
|
|
```
|
|
|
|
You should see the new columns `item_image` and `image_mime_type`.
|