"""
Check the structure of the users table
"""
import os
import django

# Setup Django
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'branch_system.settings')
django.setup()

from django.db import connection

def check_users_table():
    """Check the users table structure"""
    with connection.cursor() as cursor:
        # Check if users table exists
        cursor.execute("""
            SHOW TABLES LIKE 'users%'
        """)
        user_tables = cursor.fetchall()
        
        print("Tables starting with 'users':")
        for table in user_tables:
            print(f"  - {table[0]}")
        
        # Get the structure of the 'users' table
        print("\n" + "=" * 50)
        print("Structure of 'users' table:")
        print("=" * 50)
        
        cursor.execute("DESCRIBE users")
        columns = cursor.fetchall()
        
        for col in columns:
            print(f"  {col[0]:<30} {col[1]:<20} {col[2]}")

if __name__ == '__main__':
    check_users_table()
