This commit is contained in:
2025-06-02 18:17:32 +03:00
commit 0832ebf702
11 changed files with 865 additions and 0 deletions

View File

@ -0,0 +1,15 @@
-- +goose Up
-- +goose StatementBegin
SELECT 'up SQL query';
CREATE VIEW IF NOT EXISTS total_karma AS SELECT u.id, u.name, sum(change) as total from karma
INNER JOIN users u ON u.id=karma.to_user
WHERE 1
GROUP BY u.id
ORDER BY total DESC;
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
SELECT 'down SQL query';
DROP VIEW total_karma
-- +goose StatementEnd