fix(team-plans): track departed member usage so value not lost (#2118)

* fix(team-plans): track departed member usage so value not lost

* reset usage to 0 when they leave team

* prep merge with stagig

* regen migrations

* fix org invite + ws selection'

---------

Co-authored-by: Waleed <walif6@gmail.com>
This commit is contained in:
Vikhyath Mondreti
2025-11-29 18:27:12 -08:00
committed by GitHub
parent 7bf9251db1
commit fc5f815c7a
10 changed files with 7784 additions and 139 deletions

View File

@@ -0,0 +1 @@
ALTER TABLE "organization" ADD COLUMN "departed_member_usage" numeric DEFAULT '0' NOT NULL;

File diff suppressed because it is too large Load Diff

View File

@@ -792,6 +792,13 @@
"when": 1764370369484,
"tag": "0113_calm_tiger_shark",
"breakpoints": true
},
{
"idx": 114,
"version": "7",
"when": 1764468360258,
"tag": "0114_wise_sunfire",
"breakpoints": true
}
]
}

View File

@@ -745,7 +745,8 @@ export const organization = pgTable('organization', {
logo: text('logo'),
metadata: json('metadata'),
orgUsageLimit: decimal('org_usage_limit'),
storageUsedBytes: bigint('storage_used_bytes', { mode: 'number' }).notNull().default(0), // Storage tracking for team/enterprise
storageUsedBytes: bigint('storage_used_bytes', { mode: 'number' }).notNull().default(0),
departedMemberUsage: decimal('departed_member_usage').notNull().default('0'),
createdAt: timestamp('created_at').defaultNow().notNull(),
updatedAt: timestamp('updated_at').defaultNow().notNull(),
})