Add asset metadata, sharing, and MinIO-backed signed links.
CI / test (pull_request) Successful in 4s

This introduces deduplicated per-user image/3D asset records linked into feature properties, adds visibility-controlled download routing, and wires local S3-compatible storage with automatic bucket bootstrap in Docker Compose.

Made-with: Cursor
This commit is contained in:
2026-03-02 21:03:08 +00:00
parent 184c5cb59f
commit f6f46f6db1
18 changed files with 1125 additions and 16 deletions
+22 -3
View File
@@ -3,7 +3,11 @@ package store
import (
"database/sql"
"embed"
"fmt"
"io/fs"
"log"
"path/filepath"
"sort"
_ "github.com/jackc/pgx/v5/stdlib"
)
@@ -17,12 +21,27 @@ func Migrate(databaseURL string) error {
return err
}
defer db.Close()
sql, err := migrationsFS.ReadFile("migrations/0001_init.sql")
files, err := fs.ReadDir(migrationsFS, "migrations")
if err != nil {
return err
}
if _, err := db.Exec(string(sql)); err != nil {
return err
paths := make([]string, 0, len(files))
for _, entry := range files {
if entry.IsDir() || filepath.Ext(entry.Name()) != ".sql" {
continue
}
paths = append(paths, "migrations/"+entry.Name())
}
sort.Strings(paths)
for _, path := range paths {
sqlBytes, readErr := migrationsFS.ReadFile(path)
if readErr != nil {
return readErr
}
if _, execErr := db.Exec(string(sqlBytes)); execErr != nil {
return fmt.Errorf("%s: %w", path, execErr)
}
}
log.Printf("migrations applied")
return nil