feat: implement core platform features including business directory, admin dashboard, authentication, and API infrastructure
Some checks failed
Build and Push App / build (push) Failing after 16m2s
Some checks failed
Build and Push App / build (push) Failing after 16m2s
This commit is contained in:
44
scratch/update_settings.ts
Normal file
44
scratch/update_settings.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
import { PrismaPg } from '@prisma/adapter-pg';
|
||||
import pg from 'pg';
|
||||
|
||||
async function main() {
|
||||
const connectionString = process.env.DATABASE_URL;
|
||||
if (!connectionString) {
|
||||
console.error('DATABASE_URL is not set');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const pool = new pg.Pool({ connectionString });
|
||||
const adapter = new PrismaPg(pool);
|
||||
const prisma = new PrismaClient({ adapter });
|
||||
|
||||
console.log('🔄 Updating Site Settings in database...');
|
||||
|
||||
try {
|
||||
const settings = await prisma.siteSetting.upsert({
|
||||
where: { id: 'singleton' },
|
||||
update: {
|
||||
siteName: 'Afrohub',
|
||||
siteSlogan: "La plateforme de référence pour l'entrepreneuriat africain. Visibilité, connexion et croissance pour les TPE/PME.",
|
||||
contactEmail: 'support@afrohub.com',
|
||||
footerText: '© 2025 Afrohub. Tous droits réservés.',
|
||||
},
|
||||
create: {
|
||||
id: 'singleton',
|
||||
siteName: 'Afrohub',
|
||||
siteSlogan: "La plateforme de référence pour l'entrepreneuriat africain. Visibilité, connexion et croissance pour les TPE/PME.",
|
||||
contactEmail: 'support@afrohub.com',
|
||||
footerText: '© 2025 Afrohub. Tous droits réservés.',
|
||||
},
|
||||
});
|
||||
console.log('✅ Settings updated:', settings);
|
||||
} catch (error) {
|
||||
console.error('❌ Error updating settings:', error);
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
Reference in New Issue
Block a user