-- Fix attendance_monthly_grid table - ensure attendance_grid_id is AUTO_INCREMENT
-- Run this SQL to fix the table structure

-- First, check current table structure
-- SHOW CREATE TABLE attendance_monthly_grid;

-- Fix: Modify the attendance_grid_id column to be AUTO_INCREMENT PRIMARY KEY
ALTER TABLE `attendance_monthly_grid` 
MODIFY COLUMN `attendance_grid_id` INT(11) NOT NULL AUTO_INCREMENT;

-- If above fails, try this alternative approach:
-- ALTER TABLE `attendance_monthly_grid` 
-- CHANGE `attendance_grid_id` `attendance_grid_id` INT(11) NOT NULL AUTO_INCREMENT FIRST;

-- Verify the fix
-- SHOW CREATE TABLE attendance_monthly_grid;
