mirror of
https://github.com/therootcompany/golib.git
synced 2026-11-04 15:05:00 +00:00
Demonstrates pgmigrate with embedded SQL migrations: up, down, status, and reset commands. Two migrations (init + create-todos) show the minimum viable pattern for using sqlmigrate with PostgreSQL.
9 lines
264 B
SQL
9 lines
264 B
SQL
CREATE TABLE todos (
|
|
id CHAR(8) PRIMARY KEY,
|
|
title VARCHAR(255) NOT NULL,
|
|
done BOOLEAN NOT NULL DEFAULT FALSE,
|
|
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
INSERT INTO _migrations (name, id) VALUES ('0002_create-todos', 'a1b2c3d4');
|