get_charset_collate(); $prefix = $wpdb->prefix; $generated_post = "CREATE TABLE {$prefix}wpwand_generated_post ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, title varchar(255) NOT NULL, content longtext DEFAULT NULL, post_id bigint(20) unsigned DEFAULT NULL, action_id bigint(20) unsigned DEFAULT NULL, status varchar(255) DEFAULT 'pending', featured_image_id bigint(20) unsigned DEFAULT NULL, created_at timestamp DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id) ) {$charset_collate};"; $history = "CREATE TABLE {$prefix}wpwand_history ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, template_name varchar(255) NOT NULL, prompt_info longtext NOT NULL, response longtext NOT NULL, created_at timestamp DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id) ) {$charset_collate};"; $custom_prompts = "CREATE TABLE {$prefix}wpwand_custom_prompts ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, title varchar(255) NOT NULL, prompt longtext DEFAULT NULL, type varchar(255) DEFAULT 'template', created_at timestamp DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id) ) {$charset_collate};"; dbDelta($generated_post); dbDelta($history); dbDelta($custom_prompts); } }