allow to upload images

but also files, hmmmm
This commit is contained in:
2026-03-16 21:45:39 +03:00
parent 3a8bc6df2d
commit d8fc6e481f
18 changed files with 437 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE images (
id varchar primary key not null,
data blob not null,
user_id integer not null,
created_at datetime default current_timestamp,
updated_at datetime default current_timestamp,
FOREIGN KEY(user_id) REFERENCES users(id)
);
CREATE TRIGGER update_images_updated_at
AFTER UPDATE ON images
FOR EACH ROW
BEGIN
UPDATE images
SET updated_at = current_timestamp
WHERE id = OLD.id;
END;
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE images;
-- +goose StatementEnd