feat(pg-migration): init

This commit is contained in:
2025-02-04 09:34:00 +00:00
parent eeda2fe61b
commit 5a78f6bbc0
7 changed files with 2675 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
use postgres::Client;
pub fn init_db(client: &mut Client) {
client.batch_execute("
CREATE SCHEMA IF NOT EXISTS hectic;
CREATE TABLE IF NOT EXISTS hectic.migration (
id SERIAL PRIMARY KEY,
name TEXT UNIQUE NOT NULL,
applied_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
").unwrap();
}