deckhearth/scripts/add-image-column.js

30 lines
729 B
JavaScript
Raw Normal View History

#!/usr/bin/env node
import { config } from 'dotenv';
import { sql } from '../lib/sql.js';
// 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();