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:
2026-11-25 13:34:22 -07:00
co-authored by Claude Opus 5.5
parent aa0408fb14
commit 6d3eb18b5e
16 changed files with 573 additions and 6 deletions
+9
View File
@@ -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
}