2025-07-25 11:06:39 -04:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
|
|
|
|
|
import { config } from 'dotenv';
|
2026-08-15 10:32:13 -04:00
|
|
|
import { sql } from '../lib/sql.js';
|
2025-07-25 11:06:39 -04:00
|
|
|
|
|
|
|
|
// Load environment variables
|
|
|
|
|
config({ path: '.env.local' });
|
|
|
|
|
|
|
|
|
|
async function addImageColumn() {
|
|
|
|
|
try {
|
|
|
|
|
console.log('🖼️ Adding image column to collections table...\n');
|
|
|
|
|
|
|
|
|
|
// Add image column to collections table
|
|
|
|
|
await sql`
|
|
|
|
|
ALTER TABLE collections
|
|
|
|
|
ADD COLUMN IF NOT EXISTS image TEXT
|
|
|
|
|
`;
|
|
|
|
|
console.log('✅ Added image column to collections table');
|
|
|
|
|
|
|
|
|
|
console.log('\n🎉 Image column added successfully!');
|
|
|
|
|
console.log('\n📋 Collections can now have hero images!');
|
|
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('❌ Migration failed:', error.message);
|
|
|
|
|
process.exit(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addImageColumn();
|