Base de donnée compatible MariaDB pour mysql faire attention au group by

/**
* TODO faire un cron pour tw_session
*/
CREATE TABLE tw_session (
    id int(10) NOT NULL AUTO_INCREMENT,
    name varchar(500) NOT NULL,
    value longtext DEFAULT NULL,
    created_at datetime DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (id)
) ENGINE = INNODB;

CREATE TABLE IF NOT EXISTS tw_supplier_product(
    id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    product_id bigint(20) unsigned NOT NULL,
    variation_id int(10) DEFAULT NULL,
    supplier_name varchar(500) NOT NULL,
    restocking_delay int(3) DEFAULT NULL,
    manage_restocking tinyint(1) DEFAULT 0,
    supplier_restocking_url varchar(500) DEFAULT NULL,
    FOREIGN KEY (product_id) REFERENCES wp_posts(ID),
    PRIMARY KEY (id)
) ENGINE = INNODB;

CREATE TABLE IF NOT EXISTS tw_delivery_product(
    id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    product_id bigint(20) unsigned NOT NULL,
    delivery_instance_id bigint(20) unsigned NOT NULL,
    FOREIGN KEY (product_id) REFERENCES wp_posts(ID),
    PRIMARY KEY (id)
) ENGINE = INNODB;

CREATE TABLE IF NOT EXISTS tw_variable_product(
    id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    product_id bigint(20) unsigned NOT NULL,
    target_product_id bigint(20) unsigned NOT NULL,
    FOREIGN KEY (product_id) REFERENCES wp_posts(ID),
    FOREIGN KEY (target_product_id) REFERENCES wp_posts(ID),
    PRIMARY KEY (id)
) ENGINE = INNODB;

update wp_options set option_value = 'no' where option_name = 'woocommerce_enable_coupons';
update wp_options set option_value = 'yes' where option_name = 'woocommerce_enable_guest_checkout';
update wp_options set option_value = 'yes' where option_name = 'woocommerce_enable_signup_and_login_from_checkout';
update wp_options set option_value = 'yes' where option_name = 'woocommerce_registration_generate_password';

Lors du déploiement initial sur le serveur
update wp_options set option_value = 'NEW_DOMAIN' where option_name = 'siteurl';
update wp_options set option_value = 'NEW_DOMAIN' where option_name = 'home';

update wp_options set option_value = 'no' where option_name = 'woocommerce_enable_myaccount_registration';

CREATE TABLE IF NOT EXISTS tw_shipping (
    expedition_id INT(10) NOT NULL AUTO_INCREMENT,
    order_id BIGINT(20),
    expedition_type VARCHAR(50),
    carrier VARCHAR(200),
    package_length DECIMAL(10,2) DEFAULT NULL,
    package_width DECIMAL(10,2) DEFAULT NULL,
    package_height DECIMAL(10,2) DEFAULT NULL,
    label_generated TINYINT(1) DEFAULT 0,
    label_generation_time DATETIME DEFAULT NULL,
    label_number VARCHAR(512) DEFAULT NULL,
    label_tracking_link VARCHAR(512) DEFAULT NULL,
    label_print_link VARCHAR(512) DEFAULT NULL,
    PRIMARY KEY (expedition_id)
) ENGINE = INNODB;
ALTER TABLE tw_shipping ADD COLUMN insurance TINYINT(1) DEFAULT 0;

CREATE TABLE IF NOT EXISTS tw_shipping_detail (
    expedition_detail_id int(10) NOT NULL AUTO_INCREMENT,
    expedition_id INT(10) NOT NULL,
    item_id INT(10),
    item_price DECIMAL(10,2),
	item_quantity DECIMAL(10,2),
	item_weight DECIMAL(10,2),
	item_length DECIMAL(10,2) DEFAULT NULL,
	item_width DECIMAL(10,2) DEFAULT NULL,
	item_height DECIMAL(10,2) DEFAULT NULL,
    PRIMARY KEY (expedition_detail_id),
    FOREIGN KEY (expedition_id) REFERENCES tw_shipping(expedition_id)
) ENGINE = INNODB;
--------------------

Dans elementor > outil > remplacement d' URL remplacer l'ancien domaine par le nouveau domaine ne pas oublier d'inclure de /
Dans elementor > outil > general régénérer les fichiers et les données
TROUVER une commande pour nettoyer les transients

--------------------

CREATE TABLE IF NOT EXISTS tw_external_stock (
    external_stock_id INT(10) NOT NULL AUTO_INCREMENT,
    product_id INT(10) NOT NULL,
    quantity INT(10) NOT NULL,
    last_checked DATETIME NOT NULL,
    PRIMARY KEY (external_stock_id)
) ENGINE = INNODB;

CREATE TABLE IF NOT EXISTS tw_linked_page (
    post_id INT(10) NOT NULL,
    page_type VARCHAR(255) NOT NULL,
    page_url TEXT DEFAULT NULL,
    widget_post_type VARCHAR(255) DEFAULT NULL,
    global_widget_template_id VARCHAR(255) DEFAULT NULL
) ENGINE = INNODB;

--------------------------

CREATE TABLE IF NOT EXISTS tw_cached_page_manager (
    creation_timestamp bigint(20) unsigned NOT NULL,
    url VARCHAR(512),
    cached TINYINT(1) DEFAULT 0
) ENGINE = INNODB;

-------------

CREATE TABLE IF NOT EXISTS tw_task (
    task_id INT(10) AUTO_INCREMENT primary key NOT NULL,
    task_category VARCHAR(255) NOT NULL,
    task_name VARCHAR(255) NOT NULL,
    task_args JSON DEFAULT NULL,
    task_success TINYINT(1) DEFAULT NULL,
    task_response JSON DEFAULT NULL,
    task_frequency VARCHAR(255) NOT NULL,
    first_execution_date DATETIME DEFAULT NULL,
    next_execution_date DATETIME DEFAULT NULL
) ENGINE = INNODB;


INSTALLER wp super cache
et le plugin avec wp package install https://github.com/wp-cli/wp-super-cache-cli.git
mettre en place une commande cron
sudo -u www-data php -d xdebug.start_with_request=yes /usr/local/bin/wp tw_preload_command preload (éventuellement)