============================================================ DATABASE SETUP STARTED ============================================================ ➤ Connecting to database server... ✓ Connected to database server successfully ➤ Creating database 'affirmbs_sales'... ✓ Database created successfully or already exists ➤ Connecting to database 'affirmbs_sales'... ✓ Connected to database successfully ============================================================ CREATING CORE TABLES ============================================================ ➤ Creating table: users ✓ Table 'users' created successfully ➤ Creating table: sales_records ✓ Table 'sales_records' created successfully ============================================================ CREATING DEFAULT USER ============================================================ ➤ Inserting default admin user... ➤ Admin user already exists ============================================================ CREATING RELATED TABLES ============================================================ ➤ Creating table: login_history ✓ Table 'login_history' created successfully ➤ Creating table: comments ✓ Table 'comments' created successfully ➤ Creating table: record_attachments ✓ Table 'record_attachments' created successfully ➤ Creating table: record_history ✓ Table 'record_history' created successfully ============================================================ ADDING FOREIGN KEY CONSTRAINTS ============================================================ ➤ Adding foreign key to login_history ✓ Foreign key added successfully ➤ Adding foreign key to comments (record_id) ✓ Foreign key added successfully ➤ Adding foreign key to comments (user_id) ✓ Foreign key added successfully ➤ Adding foreign key to record_attachments ✓ Foreign key added successfully ➤ Adding foreign key to record_history (record_id) ✓ Foreign key added successfully ➤ Adding foreign key to record_history (user_id) ✓ Foreign key added successfully ➤ Adding foreign key to sales_records ✓ Foreign key added successfully ============================================================ APPLYING COLUMN UPDATES ============================================================ ➤ Adding 'full_name' column to users table ➤ Column 'full_name' already exists in table 'users' ➤ Adding 'email' column to users table ➤ Column 'email' already exists in table 'users' ➤ Adding 'invoice_number' column to sales_records ➤ Column 'invoice_number' already exists in table 'sales_records' ➤ Adding 'invoice_date' column to sales_records ➤ Column 'invoice_date' already exists in table 'sales_records' ➤ Adding 'invoice_amount' column to sales_records ➤ Column 'invoice_amount' already exists in table 'sales_records' ➤ Adding 'rating' column to sales_records ➤ Column 'rating' already exists in table 'sales_records' ➤ Adding 'source' column to sales_records ➤ Column 'source' already exists in table 'sales_records' ============================================================ SETUP SUMMARY ============================================================ Tables Created: 6/6 Errors Encountered: 0 🎉 SETUP COMPLETED SUCCESSFULLY! Important Notes: 1. Default admin login: username='admin', password='admin' 2. Change the default password immediately for security 3. All tables have been created successfully 4. Total tables created: 6 ============================================================ TESTING DATABASE CONNECTION ============================================================ ✓ Database connection test passed Tables in database: 6 Table list: - comments - login_history - record_attachments - record_history - sales_records - users ============================================================ TABLE STRUCTURES ============================================================ ➤ Checking structure of table: users ✓ Table 'users' exists with proper structure ➤ Checking structure of table: sales_records ✓ Table 'sales_records' exists with proper structure ➤ Checking structure of table: login_history ✓ Table 'login_history' exists with proper structure ➤ Checking structure of table: comments ✓ Table 'comments' exists with proper structure ➤ Checking structure of table: record_attachments ✓ Table 'record_attachments' exists with proper structure ➤ Checking structure of table: record_history ✓ Table 'record_history' exists with proper structure ============================================================ SETUP FINISHED ============================================================