Skip to content

Schema: cloud

Part of the generated database reference.

billing_customers

  • Domain: cloud Β· Feature gate: #[cfg(feature = "cloud")] Β· Migration: 6.5.71-billing-payment-cards
  • Rust source: botschema/src/cloud.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
branch_id UUID no β€” UQ β€”
stripe_customer_id VARCHAR(255) no β€” β€” β€”
email VARCHAR(255) no β€” β€” β€”
created_at TIMESTAMPTZ no NOW() β€” β€”
updated_at TIMESTAMPTZ no NOW() β€” β€”

Indexes: idx_billing_customers_stripe_id(stripe_customer_id)

billing_payment_methods

  • Domain: cloud Β· Feature gate: #[cfg(feature = "cloud")] Β· Migration: 6.5.71-billing-payment-cards
  • Rust source: botschema/src/cloud.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
branch_id UUID no β€” β€” β€”
stripe_customer_id VARCHAR(255) no β€” β€” β€”
stripe_pm_id VARCHAR(255) no β€” UQ β€”
brand VARCHAR(50) no β€” β€” β€”
last4 VARCHAR(4) no β€” β€” β€”
exp_month INT no β€” β€” β€”
exp_year INT no β€” β€” β€”
is_default BOOLEAN no FALSE β€” β€”
created_at TIMESTAMPTZ no NOW() β€” β€”
updated_at TIMESTAMPTZ no NOW() β€” β€”

Indexes: idx_billing_payment_methods_branch(branch_id), idx_billing_payment_methods_customer(stripe_customer_id)

bot_domains

  • Domain: cloud Β· Feature gate: #[cfg(feature = "cloud")] Β· Migration: 6.5.18-bot-domains
  • Rust source: botschema/src/cloud.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
domain VARCHAR(255) no β€” UQ β€”
bot_id UUID no β€” FK bots.id
org_id UUID yes β€” FK organizations.org_id
branch_id UUID yes β€” FK branches.id
created_at TIMESTAMPTZ no NOW() β€” β€”
updated_at TIMESTAMPTZ no NOW() β€” β€”

cloud_audit_log

  • Domain: cloud Β· Feature gate: #[cfg(feature = "cloud")] Β· Migration: 6.5.71-billing-payment-cards
  • Rust source: botschema/src/cloud.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
branch_id UUID no β€” β€” β€”
actor_email VARCHAR(255) yes β€” β€” β€”
action VARCHAR(100) no β€” β€” β€”
entity VARCHAR(50) no β€” β€” β€”
entity_id VARCHAR(255) yes β€” β€” β€”
details TEXT yes β€” β€” β€”
created_at TIMESTAMPTZ no NOW() β€” β€”

Indexes: idx_cloud_audit_log_branch(branch_id, created_at DESC)

cloud_voucher_redemptions

  • Domain: cloud Β· Feature gate: #[cfg(feature = "cloud")] Β· Migration: 6.5.17-cloud-vouchers
  • Rust source: botschema/src/cloud.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
voucher_id UUID no β€” FK cloud_vouchers.id
contact_id UUID no β€” FK crm_contacts.id
org_id UUID no β€” FK organizations.org_id
branch_id UUID no β€” FK branches.id
subscription_id UUID yes β€” β€” β€”
trial_days INTEGER no β€” β€” β€”
redeemed_at TIMESTAMPTZ no NOW() β€” β€”

Indexes: cloud_voucher_redemptions_voucher_contact_uniq(voucher_id, contact_id)

cloud_vouchers

  • Domain: cloud Β· Feature gate: #[cfg(feature = "cloud")] Β· Migration: 6.5.17-cloud-vouchers
  • Rust source: botschema/src/cloud.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
code VARCHAR(20) no β€” UQ β€”
plan VARCHAR(50) no 'shared' β€” β€”
trial_days INTEGER no β€” β€” β€”
max_uses INTEGER no 1 β€” β€”
uses_count INTEGER no 0 β€” β€”
created_by UUID yes β€” FK crm_contacts.id
expires_at TIMESTAMPTZ yes β€” β€” β€”
created_at TIMESTAMPTZ no NOW() β€” β€”

cloud_workspaces

  • Domain: cloud Β· Feature gate: #[cfg(feature = "cloud")] Β· Migration: 6.5.23-branch-scope-cleanup
  • Rust source: botschema/src/cloud.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
org_id UUID no β€” β€” β€”
branch_id UUID yes β€” FK branches.id
name VARCHAR(255) no β€” β€” β€”
description TEXT yes β€” β€” β€”
icon VARCHAR(100) yes β€” β€” β€”
created_at TIMESTAMPTZ no NOW() β€” β€”
updated_at TIMESTAMPTZ no NOW() β€” β€”

workspace_resources

  • Domain: cloud Β· Feature gate: #[cfg(feature = "cloud")] Β· Migration: 6.5.14-cloud-workspaces
  • Rust source: botschema/src/cloud.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
workspace_id UUID no β€” FK cloud_workspaces.id
org_id UUID no β€” β€” β€”
store_item_id VARCHAR(255) no β€” β€” β€”
name VARCHAR(255) no β€” β€” β€”
resource_type VARCHAR(50) no β€” β€” β€”
status VARCHAR(50) no 'provisioning' β€” β€”
config JSONB yes β€” β€” β€”
provisioned_at TIMESTAMPTZ yes β€” β€” β€”
created_at TIMESTAMPTZ no NOW() β€” β€”
updated_at TIMESTAMPTZ no NOW() β€” β€”