Pular para o conteúdo principal

Esquema de Banco de Dados

Visao Geral of all database tables in FeedbackPulse SaaS.


Table Reference

Platform Tables (Not Tenant-Scoped)

TableDescriptionKey Columns
platform_settingsGlobal key-value config (encrypted for secrets)key, value
plansSubscription plans with pricing and feature flagsname, monthly_price, annual_price, max_*, feature_*
landing_pagesLanding page builder data with cached HTMLsections (JSON), cached_html, is_published
payment_eventsStripe/PayPal webhook event loggateway, event_id, event_type, payload (JSON)
audit_logsAction audit trailuser_id, action, description, old_values, new_values
cron_logsScheduled task execution logjob_name, status, output, duration_seconds

Tenant Tables

TableDescriptionKey Columns
tenantsMulti-tenant accountsname, slug, subdomain, plan_id, status, settings (JSON)
tenant_domainsCustom domain mappingstenant_id, domain, status, verified_at
usersAll user accounts (all roles)name, email, role, tenant_id, two_factor_secret
productsFeedback productstenant_id, name, slug, type, category, is_active
feedback_campaignsFeedback form configurationstenant_id, product_id, name, slug, survey_schema (JSON), status
feedback_submissionsIndividual feedback entriestenant_id, campaign_id, product_id, star_rating, nps_score, text_feedback, sentiment_*, status
feedback_tagsTag definitionstenant_id, name
feedback_submission_tagMany-to-many pivotsubmission_id, tag_id
team_membersTenant team recordstenant_id, user_id, role
team_invitationsPending invitationstenant_id, email, role, token, expires_at
api_keysTenant Chaves API (hashed)tenant_id, name, key, scopes, is_active
roadmap_itemsPublic roadmap itemstenant_id, product_id, title, status, vote_count
roadmap_votesAnonymous votes on itemsroadmap_item_id, email
feature_requestsCommunity feature suggestionstenant_id, roadmap_item_id, email, description, status
changelog_entriesProduct release notestenant_id, product_id, title, body, version, published_at
notificationsIn-app notificationstenant_id, user_id, type, title, message, data (JSON)
webhook_logsOutbound webhook delivery logstenant_id, url, event, payload (JSON), response_code
data_deletion_requestsGDPR deletion trackingtenant_id, requester_email, status, completed_at
referral_codesReferral codestenant_id, code, reward_type, uses, max_uses
referral_conversionsConversion trackingreferral_code_id, converted_tenant_id, reward_amount
scheduled_report_logsReport delivery logtenant_id, report_type, status, sent_at

Laravel System Tables

TableDescription
migrationsMigration tracking
password_reset_tokensPassword reset tokens (tenant-aware)
sessionsUser sessions
cacheApplication cache
jobsQueue jobs
failed_jobsFailed 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

Isolamento de Dados

Every tenant-scoped table has:

  • tenant_id foreign key with ON DELETE CASCADE
  • Composite index on (tenant_id, created_at)
  • TenantScope global scope for automatic filtering

When a tenant is deleted, all their data cascades automatically.


Proximos Passos