feat(presence): migration 038 space_visits + spaces.host_requires_card
space_visits: one row per visit (check-in/out, is_host, in/out notes); partial UNIQUE (space_id,member_id) WHERE checked_out_at IS NULL = one open visit per member. RLS additive/default-deny: SELECT = any space member (presence is social), NO client write policy (validated self-resolved service-client actions only; immutable history). No new permission code; org-wide attendance is all-members by product decision. spaces.host_requires_card (bool, default true) gates host check-in. Mirrored in schema.sql, types, DATABASE_SCHEMA, DB_SCHEMA_MAP.
This commit is contained in:
@@ -172,6 +172,12 @@ export type Database = {
|
||||
Update: { id?: string; space_id?: string; connection_id?: string; card_id?: string; slot?: number; created_by?: string | null; created_at?: string; updated_at?: string }
|
||||
Relationships: []
|
||||
}
|
||||
space_visits: {
|
||||
Row: { id: string; space_id: string; member_id: string; checked_in_at: string; checked_out_at: string | null; is_host: boolean; check_in_note: string | null; check_out_note: string | null; created_at: string }
|
||||
Insert: { id?: string; space_id: string; member_id: string; checked_in_at?: string; checked_out_at?: string | null; is_host?: boolean; check_in_note?: string | null; check_out_note?: string | null; created_at?: string }
|
||||
Update: { id?: string; space_id?: string; member_id?: string; checked_in_at?: string; checked_out_at?: string | null; is_host?: boolean; check_in_note?: string | null; check_out_note?: string | null; created_at?: string }
|
||||
Relationships: []
|
||||
}
|
||||
activity_log: {
|
||||
Row: {
|
||||
action: string
|
||||
@@ -1421,6 +1427,7 @@ export type Database = {
|
||||
default_voting_window_hours: number
|
||||
description: string | null
|
||||
financial_visibility: Database["public"]["Enums"]["financial_visibility"]
|
||||
host_requires_card: boolean
|
||||
id: string
|
||||
incident_sla_hours: number
|
||||
invite_code: string | null
|
||||
@@ -1446,6 +1453,7 @@ export type Database = {
|
||||
default_voting_window_hours?: number
|
||||
description?: string | null
|
||||
financial_visibility?: Database["public"]["Enums"]["financial_visibility"]
|
||||
host_requires_card?: boolean
|
||||
id?: string
|
||||
incident_sla_hours?: number
|
||||
invite_code?: string | null
|
||||
@@ -1471,6 +1479,7 @@ export type Database = {
|
||||
default_voting_window_hours?: number
|
||||
description?: string | null
|
||||
financial_visibility?: Database["public"]["Enums"]["financial_visibility"]
|
||||
host_requires_card?: boolean
|
||||
id?: string
|
||||
incident_sla_hours?: number
|
||||
invite_code?: string | null
|
||||
|
||||
Reference in New Issue
Block a user