#!/usr/bin/env python
"""Create the utils_systemsetting table"""
import os
import django

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

from django.db import connection

with connection.cursor() as cursor:
    cursor.execute("""
        CREATE TABLE IF NOT EXISTS utils_systemsetting (
            id bigint AUTO_INCREMENT NOT NULL PRIMARY KEY,
            `key` varchar(50) NOT NULL UNIQUE,
            value longtext NOT NULL,
            category varchar(20) NOT NULL,
            description longtext NULL,
            is_public bool NOT NULL,
            created_at datetime(6) NOT NULL,
            updated_at datetime(6) NOT NULL
        )
    """)
    print("Table utils_systemsetting created successfully!")
