fix(materi): align tags column type to jsonb (schema ↔ migration mismatch)

The Drizzle schema used pgText('tags').array() which emits a Postgres
text[] column, but the migration defines tags as jsonb. The mismatch caused
INSERT/LIST on materi_documents to throw INTERNAL_SERVER_ERROR (500) because
Drizzle sent a text[] where the column expected jsonb.

- schema.ts: tags → pgJsonb('tags').notNull().default('[]')
- migration: dropped+recreated to match schema (jsonb, ms epoch defaults,
  owner_user_id default 'anonymous')
This commit is contained in:
mytheclipsebotreview
2026-08-20 19:08:32 +07:00
parent 7f4196124d
commit f1d90b6097
2 changed files with 21 additions and 19 deletions
@@ -616,7 +616,7 @@ export const pgMateriDocumentsTable = pgTable(
description: pgText("description"),
content: pgText("content").notNull(),
category: pgText("category").notNull().default("general"),
tags: pgText("tags").array(),
tags: pgJsonb("tags").notNull().default("[]"),
owner_user_id: pgText("owner_user_id").notNull(),
guild_id: pgText("guild_id"),
channel_id: pgText("channel_id"),