Add per-user saved column visibility for tables

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-05 11:56:49 +03:30
co-authored by Cursor
parent 75ff2c36c4
commit 23c83ffbee
29 changed files with 624 additions and 23 deletions
+17
View File
@@ -264,6 +264,7 @@ model User {
billingAccount BillingAccount?
auditLogs AuditLog[] @relation("AuditLogActor")
savedViews SavedView[] @relation("SavedViewOwner")
tablePreferences UserTablePreference[]
assignedProjectCards ProjectCard[] @relation("ProjectCardAssignees")
teamMemberships TeamMember[]
reservationAssignments ReservationAppointment[] @relation("ReservationAssignee")
@@ -1712,6 +1713,22 @@ model AuditLog {
}
/// فیلترهای ذخیره‌شده برای لیست‌ها و کاریزها
/// ستون‌های مخفی هر جدول برای هر کاربر (به‌ازای هر سازمان)
model UserTablePreference {
id String @id @default(cuid())
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
organizationId String
tableKey String
/// ستون جدیدی که بعداً اضافه شود به‌صورت پیش‌فرض نمایش داده می‌شود
hiddenColumns String[] @default([])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([userId, organizationId, tableKey])
@@index([userId, organizationId])
}
model SavedView {
id String @id @default(cuid())
organizationId String