mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-17 00:59:40 +02:00
fix(db): use TEXT for user_id columns across entire codebase
Better Auth generates non-UUID user IDs (32-char base62 format like
'otUe1YrfENPdHnrF3g1vSBfpkQfambCZ'). Changed all `uuid('user_id')` to
`text('user_id')` in Drizzle schemas for consistency with auth system.
Affected packages/apps:
- apps/calendar, clock, picture, zitare
- games/figgos, voxelava
- packages/manadeck-database, news-database, uload-database
- services/mana-core-auth (feedback schema)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
4e63f3f74b
commit
f440ca2a8d
33 changed files with 73 additions and 53 deletions
|
|
@ -1,8 +1,17 @@
|
|||
import { pgTable, uuid, varchar, time, boolean, integer, timestamp } from 'drizzle-orm/pg-core';
|
||||
import {
|
||||
pgTable,
|
||||
uuid,
|
||||
text,
|
||||
varchar,
|
||||
time,
|
||||
boolean,
|
||||
integer,
|
||||
timestamp,
|
||||
} from 'drizzle-orm/pg-core';
|
||||
|
||||
export const alarms = pgTable('alarms', {
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
userId: uuid('user_id').notNull(),
|
||||
userId: text('user_id').notNull(),
|
||||
label: varchar('label', { length: 255 }),
|
||||
time: time('time').notNull(),
|
||||
enabled: boolean('enabled').default(true).notNull(),
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { pgTable, uuid, varchar, integer, jsonb, timestamp } from 'drizzle-orm/pg-core';
|
||||
import { pgTable, uuid, text, varchar, integer, jsonb, timestamp } from 'drizzle-orm/pg-core';
|
||||
|
||||
export interface PresetSettings {
|
||||
// For pomodoro presets
|
||||
|
|
@ -12,7 +12,7 @@ export interface PresetSettings {
|
|||
|
||||
export const presets = pgTable('presets', {
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
userId: uuid('user_id').notNull(),
|
||||
userId: text('user_id').notNull(),
|
||||
type: varchar('type', { length: 20 }).notNull(), // 'timer' | 'pomodoro'
|
||||
name: varchar('name', { length: 255 }).notNull(),
|
||||
durationSeconds: integer('duration_seconds').notNull(),
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { pgTable, uuid, varchar, integer, timestamp } from 'drizzle-orm/pg-core';
|
||||
import { pgTable, uuid, text, varchar, integer, timestamp } from 'drizzle-orm/pg-core';
|
||||
|
||||
export const timers = pgTable('timers', {
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
userId: uuid('user_id').notNull(),
|
||||
userId: text('user_id').notNull(),
|
||||
label: varchar('label', { length: 255 }),
|
||||
durationSeconds: integer('duration_seconds').notNull(),
|
||||
remainingSeconds: integer('remaining_seconds'),
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { pgTable, uuid, varchar, integer, timestamp } from 'drizzle-orm/pg-core';
|
||||
import { pgTable, uuid, text, varchar, integer, timestamp } from 'drizzle-orm/pg-core';
|
||||
|
||||
export const worldClocks = pgTable('world_clocks', {
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
userId: uuid('user_id').notNull(),
|
||||
userId: text('user_id').notNull(),
|
||||
timezone: varchar('timezone', { length: 100 }).notNull(), // IANA timezone e.g. 'America/New_York'
|
||||
cityName: varchar('city_name', { length: 255 }).notNull(),
|
||||
sortOrder: integer('sort_order').default(0).notNull(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue