wumvi/wm.php.mysql-migration

v1.0.1 2023-12-20 23:45 UTC

This package is auto-updated.

Last update: 2024-10-21 01:47:45 UTC


README

Create migration user

create database db123;
CREATE USER 'migration_user'@'%' IDENTIFIED WITH mysql_native_password BY 'pwd123';
GRANT ALL PRIVILEGES ON db123.* TO 'migration_user'@'%';
FLUSH PRIVILEGES;

Create migration table

CREATE TABLE `migration_log` (
                                 `id` int unsigned NOT NULL AUTO_INCREMENT,
                                 `index` int unsigned NOT NULL,
                                 `filename` varchar(255) NOT NULL,
                                 `date_add` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                                 PRIMARY KEY (`id`),
                                 UNIQUE KEY `migration_log_pk` (`filename`)
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci

Test

docker run -ti --rm -v "$(pwd)":/data/ --workdir /data/ --network host dfuhbu/php8.3-cli-dev:1 bash