Skip to content

πŸ“ˆ Open source, privacy-first web analytics β€” a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Clean-up unused columns

Blue Mouse7cc64a2ecd66
diff --git a/backend/apps/cloud/src/admin/admin.service.ts b/backend/apps/cloud/src/admin/admin.service.ts
index bd0b43970..96291e1a2 100644
--- a/backend/apps/cloud/src/admin/admin.service.ts
+++ b/backend/apps/cloud/src/admin/admin.service.ts
@@ -2056,7 +2056,7 @@ export class AdminService {
if (search) {
query = query.andWhere(
- '(LOWER(user.email) LIKE :search OR LOWER(user.id) LIKE :search OR LOWER(user.nickname) LIKE :search)',
+ '(LOWER(user.email) LIKE :search OR LOWER(user.id) LIKE :search)',
{ search: `%${search.toLowerCase()}%` },
)
}
@@ -2083,7 +2083,6 @@ export class AdminService {
return {
id: user.id,
email: user.email,
- nickname: user.nickname,
planCode: user.planCode,
planType: getEffectivePlanType(user),
billingFrequency: user.billingFrequency,
diff --git a/backend/apps/cloud/src/task-manager/task-manager.service.ts b/backend/apps/cloud/src/task-manager/task-manager.service.ts
index 148d1ea6b..b2aab1f5d 100644
--- a/backend/apps/cloud/src/task-manager/task-manager.service.ts
+++ b/backend/apps/cloud/src/task-manager/task-manager.service.ts
@@ -1729,9 +1729,6 @@ export class TaskManagerService {
...sent,
[step.key]: now.toISOString(),
},
- ...(step.key === TrialLifecycleEmailKey.EndsTomorrow
- ? { trialReminderSent: true }
- : {}),
})
} catch (reason) {
this.logger.error(
diff --git a/backend/apps/cloud/src/user/dto/update-user.dto.ts b/backend/apps/cloud/src/user/dto/update-user.dto.ts
index 512e8c70a..1d9abdea2 100644
--- a/backend/apps/cloud/src/user/dto/update-user.dto.ts
+++ b/backend/apps/cloud/src/user/dto/update-user.dto.ts
@@ -1,5 +1,5 @@
import { ApiProperty } from '@nestjs/swagger'
-import { IsEmail, IsOptional, IsString, Matches } from 'class-validator'
+import { IsEmail, IsOptional, IsString } from 'class-validator'
import { TimeFormat } from '../entities/user.entity'
export class UpdateUserProfileDTO {
@@ -26,24 +26,4 @@ export class UpdateUserProfileDTO {
@ApiProperty({ example: '24-hour', enum: TimeFormat })
timeFormat: string
-
- @ApiProperty({ required: false, nullable: true })
- @Matches(
- /^https:\/\/hooks\.slack\.com\/services\/T[a-zA-Z0-9]{8,11}\/B[a-zA-Z0-9]{8,11}\/[a-zA-Z0-9]{24}$/,
- { message: 'Invalid Slack Webhook URL' },
- )
- @IsString()
- @IsOptional()
- slackWebhookUrl?: string | null
-
- @ApiProperty({ required: false, nullable: true })
- @Matches(
- /^https:\/\/(?:[a-zA-Z0-9-]+\.)*discord\.com\/api\/webhooks\/\d{17,20}\/[a-zA-Z0-9_-]+$/,
- {
- message: 'Invalid Discord Webhook URL',
- },
- )
- @IsString()
- @IsOptional()
- discordWebhookUrl?: string | null
}
diff --git a/backend/apps/cloud/src/user/entities/user.entity.ts b/backend/apps/cloud/src/user/entities/user.entity.ts
index cf028d7a5..296b84af3 100644
--- a/backend/apps/cloud/src/user/entities/user.entity.ts
+++ b/backend/apps/cloud/src/user/entities/user.entity.ts
@@ -642,9 +642,6 @@ export class User {
@Column({ type: 'json', nullable: true })
entitlementOverrides: Record<string, unknown> | null
- @Column('varchar', { length: 100, nullable: true, default: null })
- nickname: string | null
-
@Column('varchar', { length: 254, unique: true })
email: string
@@ -712,9 +709,6 @@ export class User {
@Column({ default: false })
isTwoFactorAuthenticationEnabled: boolean
- @Column({ default: false })
- trialReminderSent: boolean
-
@Column({ type: 'json', nullable: true })
trialLifecycleEmailsSent: Record<string, string> | null
@@ -779,12 +773,6 @@ export class User {
})
apiKey: string | null
- @Column('varchar', { default: null })
- slackWebhookUrl: string | null
-
- @Column('varchar', { default: null })
- discordWebhookUrl: string | null
-
@Column({
type: 'varchar',
unique: true,
diff --git a/backend/apps/cloud/src/user/user.controller.ts b/backend/apps/cloud/src/user/user.controller.ts
index 2a6133541..a9bb16b99 100644
--- a/backend/apps/cloud/src/user/user.controller.ts
+++ b/backend/apps/cloud/src/user/user.controller.ts
@@ -774,18 +774,6 @@ export class UserController {
)
}
- if (userDTO.slackWebhookUrl === null) {
- await this.userService.update(id, {
- slackWebhookUrl: null,
- })
- }
-
- if (userDTO.discordWebhookUrl === null) {
- await this.userService.update(id, {
- discordWebhookUrl: null,
- })
- }
-
if (userDTO.timeFormat && user.timeFormat !== userDTO.timeFormat) {
await this.userService.update(id, {
timeFormat: userDTO.timeFormat,
@@ -793,14 +781,10 @@ export class UserController {
}
const userToUpdate = _pick(userDTO, [
- 'nickname',
'password',
'reportFrequency',
'timezone',
- 'theme',
'showLiveVisitorsInTitle',
- 'slackWebhookUrl',
- 'discordWebhookUrl',
'telegramChatId',
'receiveLoginNotifications',
'timeFormat',
diff --git a/backend/migrations/mysql/2026_07_25_drop_legacy_user_columns.sql b/backend/migrations/mysql/2026_07_25_drop_legacy_user_columns.sql
new file mode 100644
index 000000000..f46e0f01a
--- /dev/null
+++ b/backend/migrations/mysql/2026_07_25_drop_legacy_user_columns.sql
@@ -0,0 +1,5 @@
+ALTER TABLE `user`
+ DROP COLUMN `nickname`,
+ DROP COLUMN `trialReminderSent`,
+ DROP COLUMN `slackWebhookUrl`,
+ DROP COLUMN `discordWebhookUrl`;
diff --git a/backend/migrations/mysql/_pending_drop_legacy_user_notification_columns.sql b/backend/migrations/mysql/_pending_drop_legacy_user_notification_columns.sql
deleted file mode 100644
index 0e2bda905..000000000
--- a/backend/migrations/mysql/_pending_drop_legacy_user_notification_columns.sql
+++ /dev/null
@@ -1,25 +0,0 @@
--- Follow-up migration (DO NOT RUN until at least one release after
--- 2026_04_23_notification_channels.sql is in production).
---
--- Phase 1 of the alerts rework backfills user.telegramChatId /
--- user.slackWebhookUrl / user.discordWebhookUrl (and the matching confirmed
--- flag) into rows in `notification_channel`. The legacy columns are kept
--- intact for one release so we can roll back without losing data.
---
--- Once we are confident the new path is healthy in production, run this
--- migration to remove the legacy plumbing:
---
--- ALTER TABLE `user`
--- DROP COLUMN `telegramChatId`,
--- DROP COLUMN `isTelegramChatIdConfirmed`,
--- DROP COLUMN `slackWebhookUrl`,
--- DROP COLUMN `discordWebhookUrl`;
---
--- Also remove the corresponding columns from the User entity, the legacy
--- `remove-tg-integration` action in web/app/routes/user-settings.tsx, and
--- the helpers in backend/apps/cloud/src/integrations that still write to
--- those columns. The Telegram /start scene should be updated to create a
--- `notification_channel` row directly instead of `user.telegramChatId`.
---
--- Rename this file to a real `YYYY_MM_DD_drop_legacy_user_notification_columns.sql`
--- when you're ready to ship it.
diff --git a/web/app/lib/models/User.ts b/web/app/lib/models/User.ts
index 989b8a5ec..960a8866f 100644
--- a/web/app/lib/models/User.ts
+++ b/web/app/lib/models/User.ts
@@ -85,7 +85,6 @@ export interface User {
effectivePlanType: PlanType | null
addonOverrides: Record<string, unknown> | null
entitlementOverrides: Record<string, unknown> | null
- nickname: string
email: string
isActive: boolean
trialEndDate: string
@@ -99,13 +98,10 @@ export interface User {
subCancelURL: string | null
timezone: string
isTwoFactorAuthenticationEnabled: boolean
- trialReminderSent: boolean
billingFrequency: string | null
nextBillDate: string | null
cancellationEffectiveDate: string | null
apiKey: string | null
- slackWebhookUrl: string | null
- discordWebhookUrl: string | null
telegramChatId: string | null
isTelegramChatIdConfirmed: boolean
timeFormat: '12-hour' | '24-hour'
diff --git a/web/app/pages/Admin/UsersTab.tsx b/web/app/pages/Admin/UsersTab.tsx
index c962fd800..be2530f1a 100644
--- a/web/app/pages/Admin/UsersTab.tsx
+++ b/web/app/pages/Admin/UsersTab.tsx
@@ -301,7 +301,6 @@ const UserDetails = ({
const infoRows: { label: string; value: React.ReactNode }[] = [
{ label: 'ID', value: user.id },
{ label: 'Email', value: user.email },
- { label: 'Nickname', value: user.nickname || 'β€”' },
{ label: 'Registered', value: formatDateTime(user.created) },
{ label: 'Plan', value: <PlanCell user={user} /> },
{ label: 'Currency', value: user.tierCurrency || 'β€”' },
@@ -521,7 +520,7 @@ export const UsersTab = ({
label='Search users'
className='sm:max-w-xs sm:flex-1'
leadingIcon={<MagnifyingGlassIcon className='size-4 text-gray-400' />}
- placeholder='Search by email, ID or nickname'
+ placeholder='Search by email or ID'
defaultValue={search}
onChange={(event) => onSearchChange(event.target.value)}
/>
@@ -572,11 +571,6 @@ export const UsersTab = ({
<span className='font-medium'>{user.email}</span>
<UserStatusBadges user={user} />
</div>
- {user.nickname ? (
- <span className='text-xs text-gray-500 dark:text-gray-400'>
- {user.nickname}
- </span>
- ) : null}
</Td>
<Td>
<PlanCell user={user} />
diff --git a/web/app/pages/Admin/types.ts b/web/app/pages/Admin/types.ts
index 9ff90d24a..4785979b5 100644
--- a/web/app/pages/Admin/types.ts
+++ b/web/app/pages/Admin/types.ts
@@ -270,7 +270,6 @@ export interface SortState {
export interface AdminUser {
id: string
email: string
- nickname: string | null
planCode: string
planType: string | null
billingFrequency: string | null