EverydayTech Platform - Developer Reference
Complete Source Code Documentation - All Applications
Loading...
Searching...
No Matches
add_user_theme.js
Go to the documentation of this file.
1// Migration to add theme column to users table
2const pool = require('../../backend/services/db');
3
4(async function run(){
5 try {
6 console.log('Running backend migration: add theme column to users');
7 const sql = "ALTER TABLE users ADD COLUMN IF NOT EXISTS theme VARCHAR(50);";
8 await pool.query(sql);
9 console.log('Migration applied successfully');
10 } catch (err) {
11 console.error('Migration failed:', err);
12 process.exitCode = 1;
13 } finally {
14 try { await pool.end(); } catch(e){}
15 }
16})();