moved the project to this repository

This commit is contained in:
Timmelmann
2026-08-08 14:38:42 +02:00
commit 33e8a53dc1
12 changed files with 678 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
-- name: CreateUser :one
INSERT INTO users (id, created_at, updated_at, name, api_key)
VALUES ($1, $2, $3, $4, encode(sha256(random()::text::bytea), 'hex'))
RETURNING *;
-- name: GetUser :one
SELECT * FROM users WHERE api_key = $1;
+10
View File
@@ -0,0 +1,10 @@
-- +goose Up
CREATE TABLE users (
id UUID PRIMARY KEY,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
name VARCHAR(255) NOT NULL
);
-- +goose Down
DROP TABLE users;
+5
View File
@@ -0,0 +1,5 @@
-- +goose Up
ALTER TABLE users ADD api_key VARCHAR(64) NOT NULL DEFAULT encode(sha256(random()::text::bytea), 'hex') UNIQUE;
-- +goose Down
ALTER TABLE users DROP COLUMN api_key;
+12
View File
@@ -0,0 +1,12 @@
-- +goose Up
CREATE TABLE feeds (
id UUID PRIMARY KEY,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
name VARCHAR(255) NOT NULL,
url VARCHAR(255) NOT NULL UNIQUE,
user_id VARCHAR(255) NOT NULL
);
-- +goose Down
DROP TABLE feeds;