chore: clean up backend code and build shared deps in CI
Lint / Lint (push) Successful in 1m5s
Tests / Go backend (push) Failing after 1m17s
Docker / Docker Build & Push (push) Failing after 4m28s
Tests / Dashboard checks (push) Successful in 1m6s

This commit is contained in:
Gabriel20xx committed 2026-10-20 19:31:16 +00:00
1 parent 97c237be80
commit 94d52c7622
10 files changed
+17 -150

No files matched your search

+4 -2
View File
@@ -17,8 +17,8 @@ import "context"
//
// Each per-service backend additionally runs its own migration for tables
// it exclusively owns (e.g. ContentScanner's media_worker_jobs/
// media_analysis_tasks, CraftStudio's generated_media/downloaded_media,
// ProjectConfigurator's mount_paths) - those are NOT run here.
// media_analysis_tasks, CraftStudio's generated_media/downloaded_media) -
// those are NOT run here.
func (c *Core) Migrate(ctx context.Context) error {
for _, statement := range migrationStatements {
if _, err := c.db.Exec(ctx, statement); err != nil {
@@ -67,6 +67,7 @@ var migrationStatements = []string{
file_path TEXT,
original_filename TEXT,
active BOOLEAN NOT NULL DEFAULT TRUE,
content_scanner_processed BOOLEAN NOT NULL DEFAULT FALSE,
metadata JSONB NOT NULL DEFAULT '{}'::jsonb,
width INT,
height INT,
@@ -81,6 +82,7 @@ var migrationStatements = []string{
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
modified_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
)`,
`ALTER TABLE media ADD COLUMN IF NOT EXISTS content_scanner_processed BOOLEAN NOT NULL DEFAULT FALSE`,
`ALTER TABLE media ADD COLUMN IF NOT EXISTS funscript_action_count INT`,
`ALTER TABLE media ADD COLUMN IF NOT EXISTS funscript_avg_speed REAL`,
`ALTER TABLE media ADD COLUMN IF NOT EXISTS funscript_max_speed REAL`,
@@ -255,6 +255,7 @@ func TestMediaStreamAndThumbnailAgainstPostgres(t *testing.T) {
func TestMediaStatsAndViewsAgainstPostgres(t *testing.T) {
h := newDBHarness(t)
h.insertMedia(t, "rt-stats", "video", "rt-stats.mp4", true)
state := func(token string) map[string]any {
return dataOf(t, h.do(http.MethodGet, "/media/state?mediaKey=rt-stats", token, ""))
}