This commit is contained in:
Michael
2026-04-29 20:11:57 +02:00
commit a14103ad8e
167 changed files with 7060 additions and 0 deletions

View File

@ -0,0 +1,9 @@
-- +goose Up
-- +goose StatementBegin
CREATE SCHEMA IF NOT EXISTS qrcode;
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP SCHEMA IF EXISTS qrcode;
-- +goose StatementEnd

View File

@ -0,0 +1,18 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE qrcode.users (
id uuid PRIMARY KEY,
email TEXT NOT NULL UNIQUE,
password TEXT NOT NULL,
name TEXT,
is_active BOOLEAN NOT NULL DEFAULT TRUE,
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP NOT NULL DEFAULT NOW(),
deleted_at TIMESTAMP DEFAULT NULL
);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE IF EXISTS qrcode.users;
-- +goose StatementEnd

View File

@ -0,0 +1,23 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE qrcode.qrs (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL,
slug TEXT NOT NULL,
url TEXT NOT NULL,
visits INTEGER NOT NULL DEFAULT 0,
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP NOT NULL DEFAULT NOW(),
deleted_at TIMESTAMP NULL,
CONSTRAINT fk_qrs_user
FOREIGN KEY (user_id)
REFERENCES qrcode.users(id)
ON DELETE CASCADE
);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE IF EXISTS qrcode.qrs;
-- +goose StatementEnd