EverydayTech Platform - Developer Reference
Complete Source Code Documentation - All Applications
Loading...
Searching...
No Matches
migrate-wordpress-tables.js
Go to the documentation of this file.
1const pool = require('./services/db');
2const fs = require('fs');
3const path = require('path');
4
5const migrationFile = path.join(__dirname, 'migrations', 'add-wordpress-monitoring-tables.sql');
6const sql = fs.readFileSync(migrationFile, 'utf8');
7
8pool.query(sql)
9 .then(() => {
10 console.log('✓ WordPress monitoring tables created successfully');
11 process.exit(0);
12 })
13 .catch(err => {
14 console.error('✗ Migration failed:', err.message);
15 process.exit(1);
16 });