fix: remove dummy data from sql and automate schema migrations on startup
All checks were successful
Build and Deploy / build-and-push (push) Successful in 1m7s
All checks were successful
Build and Deploy / build-and-push (push) Successful in 1m7s
This commit is contained in:
@@ -661,6 +661,21 @@ const provisionSuperAdmin = async (retries = 10, delay = 10000) => {
|
||||
PRIMARY KEY (email)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
`);
|
||||
|
||||
// Add slug column if it doesn't exist
|
||||
try {
|
||||
await connection.query('ALTER TABLE users ADD COLUMN slug VARCHAR(255) UNIQUE DEFAULT NULL');
|
||||
} catch (err) {
|
||||
// Ignore error if column already exists (ER_DUP_FIELDNAME)
|
||||
if (err.code !== 'ER_DUP_FIELDNAME') console.log('Schema update note (slug):', err.message);
|
||||
}
|
||||
|
||||
// Update origin enum
|
||||
try {
|
||||
await connection.query("ALTER TABLE attendances MODIFY COLUMN origin ENUM('WhatsApp','Instagram','Website','LinkedIn','Indicação') NOT NULL");
|
||||
} catch (err) {
|
||||
console.log('Schema update note (origin):', err.message);
|
||||
}
|
||||
|
||||
connection.release();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user