
import os
import django
from django.db import connection

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
django.setup()

table_name = 'candidates_candidateprofile_preferred_abroad_categories'

with connection.cursor() as cursor:
    cursor.execute("SHOW TABLES LIKE %s", [table_name])
    row = cursor.fetchone()
    if row:
        print(f"Table '{table_name}' EXISTS.")
    else:
        print(f"Table '{table_name}' DOES NOT EXIST.")
