mirror of
https://github.com/therootcompany/golib.git
synced 2026-11-04 15:05:00 +00:00
Demonstrates mymigrate with embedded SQL migrations: up, down, status, and reset commands. Two migrations (init + create-todos) show the minimum viable pattern for using sqlmigrate with MySQL/MariaDB. Verified against MariaDB 11.4.9 via sclient --alpn mysql.
8 lines
238 B
SQL
8 lines
238 B
SQL
CREATE TABLE IF NOT EXISTS _migrations (
|
|
id CHAR(8) PRIMARY KEY,
|
|
name VARCHAR(80) NULL UNIQUE,
|
|
applied_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
INSERT INTO _migrations (name, id) VALUES ('0001_init-migrations', '00000001');
|