Commit Graph

14 Commits

Author SHA1 Message Date
a0c01d388c fix: remove duplicate statements from migration 0004 and orphan migration file
All checks were successful
CI / ci (push) Successful in 1m9s
CI / e2e (push) Has been skipped
CI / deploy (push) Successful in 1m19s
Migration 0004 contained CREATE TABLE and ALTER TABLE statements already
applied in migrations 0002 and 0003, causing PGlite test DB initialization
to fail (311 test failures). Stripped to only the new dominant_color and
crop_* columns. Also removed orphan 0000_fuzzy_shiva.sql.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 21:07:18 +02:00
b637b105fb feat(29-01): generate migration for image presentation fields
Migration adds dominant_color, crop_zoom, crop_x, crop_y to items,
global_items, and thread_candidates. Run db:push to apply.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 19:56:01 +02:00
c8ebbf8139 feat(25-01): Zod schemas, upsert service functions, passing tests
- Add upsertGlobalItemSchema and bulkUpsertGlobalItemsSchema to schemas.ts
- Add UpsertGlobalItemInput and BulkUpsertGlobalItemsInput types to types.ts
- Implement upsertGlobalItem with onConflictDoUpdate and tag sync
- Implement bulkUpsertGlobalItems processing array in single transaction
- Fix migration 0003 to only add new columns + unique constraint
- All 21 tests pass including 8 new upsert operation tests
2026-04-10 10:58:36 +02:00
39ef9cc433 feat(25-01): add attribution columns and unique constraint to globalItems
- Add sourceUrl, imageCredit, imageSourceUrl nullable columns
- Add unique constraint on (brand, model) pair
- Generate migration 0003_loving_serpent_society.sql
2026-04-10 10:55:55 +02:00
7dbbfcb915 fix: resolve all 13 remaining test failures
Some checks failed
CI / ci (push) Failing after 56s
CI / e2e (push) Has been skipped
- OAuth: add userId to oauth_codes schema and migration, derive userId
  from stored auth code/token record instead of passing separately
- Auth middleware tests: destructure {db, userId} from createTestDb,
  pass userId to createApiKey, fix error message assertion
- MCP tests: add missing await on getCollectionSummary and
  createSecondTestUser calls

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 20:25:41 +02:00
c09183d94a fix: optimize test infrastructure and fix missing brand migration
Some checks failed
CI / ci (push) Failing after 13s
CI / e2e (push) Has been skipped
- Share PGlite instance per test file (TRUNCATE RESTART IDENTITY instead
  of creating new instance per test) — tests run in ~9s vs minutes
- Add missing 'brand' column to items table migration
- Fix corrupt 0002 snapshot (merge conflict artifacts)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 20:08:11 +02:00
55829f20fb fix: remove duplicate tags migration (already in 0002_wakeful_vermin) 2026-04-06 08:00:20 +02:00
62249b5b48 Merge branch 'worktree-agent-adbc35a5' into Develop
# Conflicts:
#	.planning/STATE.md
#	drizzle-pg/meta/0002_snapshot.json
#	drizzle-pg/meta/_journal.json
#	src/db/schema.ts
2026-04-06 08:00:04 +02:00
2ec1276849 feat(20-01): add tags table, tag service/route, register global-items route
- Create tags table in schema with id, name (unique), createdAt
- Generate migration for tags table
- Create tag.service.ts with getAllTags (id+name, alphabetical order)
- Create tags.ts route with GET / handler
- Register /api/global-items and /api/tags routes in index.ts
- Add auth skip for GET /api/tags and GET /api/global-items
2026-04-06 07:56:40 +02:00
5df513c138 feat(19-01): update schema with reference item model and tags tables
- Add globalItemId and purchasePriceCents columns to items table
- Add globalItemId column to threadCandidates table
- Add tags and globalItemTags tables for tag system
- Remove itemGlobalLinks table (replaced by direct FK)
- Generate migration with data migration step before table drop
2026-04-05 20:25:59 +02:00
82657038cc feat(18-01): add globalItems, itemGlobalLinks tables and user profile/setup visibility columns
- Add globalItems table with brand, model, category, weightGrams, priceCents, imageUrl, description
- Add itemGlobalLinks junction table linking user items to global items (unique per item)
- Add displayName, avatarUrl, bio nullable columns to users table
- Add isPublic boolean column to setups table (default false)
- Import boolean from drizzle-orm/pg-core
- Generate migration 0001_tough_boomerang.sql
2026-04-05 12:57:49 +02:00
ad309510af Merge branch 'worktree-agent-a9a8b0dc' into Develop
# Conflicts:
#	.planning/REQUIREMENTS.md
#	.planning/ROADMAP.md
#	.planning/STATE.md
#	drizzle-pg/meta/0000_snapshot.json
#	drizzle-pg/meta/_journal.json
#	src/db/schema.ts
#	src/db/seed.ts
#	src/server/middleware/auth.ts
#	src/server/services/auth.service.ts
#	src/server/services/category.service.ts
#	src/server/services/oauth.service.ts
#	tests/helpers/db.ts
2026-04-05 10:38:29 +02:00
91e93a31a5 feat(16-01): migrate schema to pgTable and add users table with userId columns
- Rewrite schema.ts from sqlite-core to pg-core (pgTable, serial, timestamp, doublePrecision)
- Add users table with id, logtoSub (unique), createdAt
- Add userId FK column to items, categories, threads, setups, apiKeys, oauthTokens
- Add composite unique constraint on categories(userId, name)
- Change settings PK to composite (userId, key)
- Remove global Uncategorized seed from seed.ts (now per-user lazy)
- Generate Drizzle pg migration
2026-04-05 10:32:51 +02:00
3bf1fd7cb8 feat(14-01): add PGlite test helper and generate initial PostgreSQL migration
- Rewrite tests/helpers/db.ts to use drizzle-orm/pglite with async createTestDb()
- Generate initial migration with 13 CREATE TABLE statements in drizzle-pg/
- Add drizzle-pg to biome ignore list (generated files)
- PGlite smoke test confirms migrations apply and seed works
2026-04-04 12:18:50 +02:00