name = $wpdb->prefix . 'ips_cartgate_queue'; $this->primary_key = 'id'; // Geändert zu 'id' } /** * Definiert die Spalten und ihre Platzhalter für prepared Statements * * @return array */ function get_columns() { return [ 'id' => '%d', // Primärschlüssel 'cg_title' => '%s', // Titel 'created' => '%s', // Erstellungsdatum 'type' => '%s', // Typ 'cg_notice' => '%s', 'status' => '%d', // Status hinzugefügt 'run_count' => '%d' // Anzahl der Durchläufe ]; } function get_indexes() { return [ 'PRIMARY', 'created', 'type' ]; } /** * Installations-Query für die Tabelle * * @return string */ function get_install_query() { return "CREATE TABLE {$this->get_name()} ( id BIGINT(20) NOT NULL AUTO_INCREMENT, cg_title VARCHAR(255) NOT NULL, created DATETIME NULL, type VARCHAR(50) NOT NULL, cg_notice VARCHAR(255) NOT NULL DEFAULT '', status TINYINT(1) NOT NULL DEFAULT 0, run_count BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (id), INDEX created (created), INDEX type (type) ) {$this->get_collate()};"; } function get_install_query_old() { return "CREATE TABLE {$this->get_name()} ( id BIGINT(20) NOT NULL AUTO_INCREMENT, -- Primärschlüssel cg_title VARCHAR(255) NOT NULL, -- Titel created DATETIME NULL, -- Erstellungsdatum type VARCHAR(50) NOT NULL, -- Typ status TINYINT(1) NOT NULL DEFAULT 0, -- Status (z. B. aktiv/inaktiv) run_count BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, -- Durchläufe PRIMARY KEY (id), -- Primärschlüssel festlegen KEY created (created), -- Index für das Erstellungsdatum KEY type (type) -- Index für den Typ ) {$this->get_collate()};"; } }