feat: create events management admin system
- Add manage_events.php form for creating/editing events - Add process_event.php endpoint for CRUD operations with image uploads - Add admin_events.php list view with sorting, filtering, and delete functionality - Add database migration to add created_by, published, created_at, updated_at columns to events table - Add event images directory structure - All features follow same patterns as trip management system
This commit is contained in:
14
docs/migrations/001_add_events_tracking_columns.sql
Normal file
14
docs/migrations/001_add_events_tracking_columns.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
-- Events Table Migration
|
||||
-- Add missing columns to events table for proper tracking and publishing control
|
||||
|
||||
-- Add columns if they don't exist (using ALTER IGNORE for compatibility)
|
||||
ALTER TABLE `events`
|
||||
ADD COLUMN `created_by` int DEFAULT NULL AFTER `promo`,
|
||||
ADD COLUMN `published` tinyint(1) DEFAULT 0 AFTER `created_by`,
|
||||
ADD COLUMN `created_at` timestamp DEFAULT CURRENT_TIMESTAMP AFTER `published`,
|
||||
ADD COLUMN `updated_at` timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER `created_at`;
|
||||
|
||||
-- Add indexes for better query performance
|
||||
ALTER TABLE `events` ADD INDEX `idx_date` (`date`);
|
||||
ALTER TABLE `events` ADD INDEX `idx_published` (`published`);
|
||||
ALTER TABLE `events` ADD INDEX `idx_created_by` (`created_by`);
|
||||
Reference in New Issue
Block a user