Files
backPRO/migrations/005_publish_interval_hours.sql
Jacek Pyziak b653cea252 Add installer functionality for WordPress with FTP and database configuration
- Create SQL migration for prompt templates used in article and image generation.
- Add migration to change publish interval from days to hours in the sites table.
- Implement InstallerController to handle installation requests and validation.
- Develop FtpService for FTP connections and file uploads.
- Create InstallerService to manage the WordPress installation process, including downloading, extracting, and configuring WordPress.
- Add index view for the installer with form inputs for FTP, database, and WordPress admin settings.
- Implement progress tracking for the installation process with AJAX polling.
2026-02-16 21:55:24 +01:00

22 lines
679 B
SQL

-- Publish interval migration: days -> hours
ALTER TABLE sites ADD COLUMN publish_interval_hours INT NOT NULL DEFAULT 24 AFTER api_token;
SET @has_old_interval_days := (
SELECT COUNT(*)
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = 'sites'
AND COLUMN_NAME = 'publish_interval_days'
);
SET @backpro_sql := IF(
@has_old_interval_days > 0,
'UPDATE sites SET publish_interval_hours = CASE WHEN publish_interval_days IS NULL OR publish_interval_days < 1 THEN 24 ELSE publish_interval_days * 24 END',
'SELECT 1'
);
PREPARE backpro_stmt FROM @backpro_sql;
EXECUTE backpro_stmt;
DEALLOCATE PREPARE backpro_stmt;