init
This commit is contained in:
23
app/migrations/20260406153310_c_qr.sql
Normal file
23
app/migrations/20260406153310_c_qr.sql
Normal 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
|
||||
Reference in New Issue
Block a user