数据库架构
概述 of all database tables in FeedbackPulse SaaS.
Table Reference
Platform Tables (Not Tenant-Scoped)
| Table | Description | Key Columns |
|---|---|---|
platform_settings | Global key-value config (encrypted for secrets) | key, value |
plans | Subscription plans with pricing and feature flags | name, monthly_price, annual_price, max_*, feature_* |
landing_pages | Landing page builder data with cached HTML | sections (JSON), cached_html, is_published |
payment_events | Stripe/PayPal webhook event log | gateway, event_id, event_type, payload (JSON) |
audit_logs | Action audit trail | user_id, action, description, old_values, new_values |
cron_logs | Scheduled task execution log | job_name, status, output, duration_seconds |
Tenant Tables
| Table | Description | Key Columns |
|---|---|---|
tenants | Multi-tenant accounts | name, slug, subdomain, plan_id, status, settings (JSON) |
tenant_domains | Custom domain mappings | tenant_id, domain, status, verified_at |
users | All user accounts (all roles) | name, email, role, tenant_id, two_factor_secret |
products | Feedback products | tenant_id, name, slug, type, category, is_active |
feedback_campaigns | Feedback form configurations | tenant_id, product_id, name, slug, survey_schema (JSON), status |
feedback_submissions | Individual feedback entries | tenant_id, campaign_id, product_id, star_rating, nps_score, text_feedback, sentiment_*, status |
feedback_tags | Tag definitions | tenant_id, name |
feedback_submission_tag | Many-to-many pivot | submission_id, tag_id |
team_members | Tenant team records | tenant_id, user_id, role |
team_invitations | Pending invitations | tenant_id, email, role, token, expires_at |
api_keys | Tenant API 密钥 (hashed) | tenant_id, name, key, scopes, is_active |
roadmap_items | Public roadmap items | tenant_id, product_id, title, status, vote_count |
roadmap_votes | Anonymous votes on items | roadmap_item_id, email |
feature_requests | Community feature suggestions | tenant_id, roadmap_item_id, email, description, status |
changelog_entries | Product release notes | tenant_id, product_id, title, body, version, published_at |
notifications | In-app notifications | tenant_id, user_id, type, title, message, data (JSON) |
webhook_logs | Outbound webhook delivery logs | tenant_id, url, event, payload (JSON), response_code |
data_deletion_requests | GDPR deletion tracking | tenant_id, requester_email, status, completed_at |
referral_codes | Referral codes | tenant_id, code, reward_type, uses, max_uses |
referral_conversions | Conversion tracking | referral_code_id, converted_tenant_id, reward_amount |
scheduled_report_logs | Report delivery log | tenant_id, report_type, status, sent_at |
Laravel System Tables
| Table | Description |
|---|---|
migrations | Migration tracking |
password_reset_tokens | Password reset tokens (tenant-aware) |
sessions | User sessions |
cache | Application cache |
jobs | Queue jobs |
failed_jobs | Failed queue jobs |
Key Relationships
plans <---- tenants <---- users
|
|---- products <---- feedback_campaigns <---- feedback_submissions
| |
| +---- feedback_tags (M2M)
|
|---- roadmap_items <---- roadmap_votes
| <---- feature_requests
|
|---- changelog_entries
|---- team_members ---- users
|---- team_invitations
|---- api_keys
|---- notifications
+---- webhook_logs
数据隔离
Every tenant-scoped table has:
tenant_idforeign key withON DELETE CASCADE- Composite index on
(tenant_id, created_at) TenantScopeglobal scope for automatic filtering
When a tenant is deleted, all their data cascades automatically.