models ====== .. py:module:: models Functions --------- .. autoapisummary:: models.init_database Module Contents --------------- .. py:function:: init_database() Initializes the PostgreSQL database by creating the necessary tables if they don't exist. This function connects to the PostgreSQL server using the provided connection parameters, creates tables for users, contacts, daily messages, contact requests, pending requests, bug reports, and a check queue. The function sets the isolation level to AUTOCOMMIT to ensure that the table creation statements are executed immediately. Tables: - users: Stores user information such as username, alert mode, and response status. - contacts: Manages user contacts and pairing status. - daily_messages: Stores scheduled daily messages for users. - contact_requests: Manages contact requests between users. - pending_requests: Handles pending contact requests. - bug_reports: Logs bug reports submitted by users. - check_queue: Manages verification checks and reminders.