Phase 14, parts 5 and 6: seats, and moving down to Free
Seats: inviting past the seats paid for offers the owner to add one (Stripe prorates it); admins are told to ask the owner; Free has two. Moving down: past the plan's seats, the owner and one other (the owner's pick, or the first to join) edit and the rest read; storage is measured hourly, and past the plan's, photo uploads and the SEO crawl stop. Nothing is deleted. TEST.md section 18. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -221,3 +221,12 @@ func (t *Teams) Close() {
|
||||
delete(t.open, id)
|
||||
}
|
||||
}
|
||||
|
||||
// Size is how many bytes a team's schema takes: its tables, their indexes
|
||||
// and what's stored beside them.
|
||||
func (t *Teams) Size(id int64) (int64, error) {
|
||||
var n sql.NullInt64
|
||||
err := t.platform.SQL.QueryRow(`SELECT sum(pg_total_relation_size(c.oid)) FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace
|
||||
WHERE n.nspname = $1 AND c.relkind IN ('r', 'm')`, t.Schema(id)).Scan(&n)
|
||||
return n.Int64, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user