···248248 `,
249249 },
250250 {
251251- version: 4,
251251+ version: 10,
252252 name: "Add email notification preferences",
253253 sql: `
254254 ALTER TABLE users ADD COLUMN email_notifications_enabled BOOLEAN DEFAULT 1;
···271271272272 CREATE INDEX IF NOT EXISTS idx_email_change_tokens_user_id ON email_change_tokens(user_id);
273273 CREATE INDEX IF NOT EXISTS idx_email_change_tokens_token ON email_change_tokens(token);
274274+ `,
275275+ },
276276+ {
277277+ version: 11,
278278+ name: "Add NOT NULL constraints and missing indexes",
279279+ sql: `
280280+ -- Note: SQLite doesn't support ALTER COLUMN to add NOT NULL to existing columns
281281+ -- These tables were created in migration 6 and 8, but the columns should have been NOT NULL
282282+ -- The constraints are enforced at the application level, this migration documents the intent
283283+284284+ -- Add missing indexes for performance
285285+ CREATE INDEX IF NOT EXISTS idx_users_email_verified ON users(email_verified);
286286+ CREATE INDEX IF NOT EXISTS idx_transcriptions_meeting_time_id ON transcriptions(meeting_time_id);
274287 `,
275288 },
276289];