add user authentication

This commit is contained in:
2026-03-16 20:18:37 +03:00
parent 1baa6a4806
commit 3a8bc6df2d
6 changed files with 175 additions and 7 deletions

View File

@@ -0,0 +1,25 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE users (
id integer primary key not null,
email varchar not null unique,
password varchar not null,
created_at datetime default current_timestamp,
updated_at datetime default current_timestamp
);
CREATE TRIGGER update_users_updated_at
AFTER UPDATE ON users
FOR EACH ROW
BEGIN
UPDATE users
SET updated_at = current_timestamp
WHERE id = OLD.id;
END;
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE users;
-- +goose StatementEnd