Adding test migrations

This commit is contained in:
2025-08-02 15:05:49 -04:00
parent 0cb9fd3f95
commit c31743eed1
4 changed files with 36 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
-- Add down migration script here
DROP TABLE IF EXISTS "user";
DROP TABLE IF EXISTS "salt";
DROP TABLE IF EXISTS "passphrase";

View File

@@ -0,0 +1,28 @@
-- Add up migration script here
CREATE EXTENSION IF NOT EXISTS pgcrypto;
CREATE TABLE IF NOT EXISTS "user" (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
username TEXT NOT NULL,
password TEXT NOT NULL,
email TEXT NOT NULL,
phone TEXT NOT NULL,
firstname TEXT NOT NULL,
lastname TEXT NOT NULL,
email_verified BOOL NOT NULL,
date_created TIMESTAMPTZ NOT NULL DEFAULT NOW(),
status TEXT NOT NULL,
last_login TIMESTAMPTZ NULL DEFAULT NOW(),
salt_id UUID NOT NULL
);
CREATE TABLE IF NOT EXISTS "salt" (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
salt TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS "passphrase" (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
passphrase TEXT NOT NULL,
date_created TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

View File

@@ -0,0 +1,2 @@
-- Add down migration script here
DELETE FROM "passphrase";

View File

@@ -0,0 +1,2 @@
-- Add up migration script here
INSERT INTO "passphrase" (passphrase) VALUES('Hg3TWfAT8pEiW6fZGhQKXICkZ246EzrE8Bx26O9iEKmQkbpzlFJTOW8UwSf09oak');