Base44 database

Database Relationship and Foreign Key Errors in Base44

Your Base44 app uses related database tables (for example, a Users table linked to an Orders table), but the relationships are not working correctly. Related records don't appear in linked views, creating a record in one table doesn't properly reference the related record in another, or deleting a record causes unexpected cascade effects.

This issue often manifests as dropdown selectors for related records showing empty lists, detail pages failing to display linked data, or errors when trying to create records that reference other tables.

Relationship issues can be subtle and may only appear with certain data combinations or when the related tables grow beyond a small number of records.

Error Messages You Might See

Referenced record not found Foreign key constraint violation Cannot delete record: referenced by other records
Referenced record not foundForeign key constraint violationCannot delete record: referenced by other records

Common Causes

  1. The relationship field type is incorrectly configured (e.g., using a text field instead of a proper reference/relation field)
  2. The referenced record was deleted but the foreign key reference still exists, creating orphaned records
  3. The relationship direction is inverted: the link field is on the wrong table
  4. The relation field references the wrong column (e.g., referencing a name field instead of the unique ID)

How to Fix It

Review your table schemas and ensure that relationship fields use Base44's proper relation/reference field type, not a plain text or number field storing IDs manually. The built-in relation type handles the linking automatically.

Check the direction of the relationship: a one-to-many relationship (e.g., one User has many Orders) requires the link field on the "many" side (Orders), not on the "one" side (Users).

For existing apps with broken relationships and orphaned records, a developer can help clean up the data and reconfigure the schema correctly without losing existing records.

Real developers can help you.

Matt Butler Matt Butler Software Engineer @ AWS Richard McSorley Richard McSorley Full-Stack Software Engineer with 8+ years building high-performance applications for enterprise clients. Shipped production systems at Walmart (4,000+ stores), Cigna (20M+ users), and Arkansas Blue Cross. 5 patents in retail/supply chain tech. Currently focused on AI integrations, automation tools, and TypeScript-first architectures. Milan Surelia Milan Surelia Milan Surelia is a Mobile App Developer with 5+ years of experience crafting scalable, cross-platform apps at 7Span and Meticha. At 7Span, he engineers feature-rich Flutter apps with smooth performance and modern UI. As the Co-Founder of Meticha, he builds open-source tools and developer-focused products that solve real-world problems. Expertise: 💡 Developing cross-platform apps using Flutter, Dart, and Jetpack Compose for Android, iOS, and Web. 🖋️ Sharing insights through technical writing, blogging, and open-source contributions. 🤝 Collaborating closely with designers, PMs, and developers to build seamless mobile experiences. Notable Achievements: 🎯 Revamped the Vepaar app into Vepaar Store & CRM with a 2x performance boost and smoother UX. 🚀 Launched Compose101 — a Jetpack Compose starter kit to speed up Android development. 🌟 Open source contributions on Github & StackOverflow for Flutter & Dart 🎖️ Worked on improving app performance and user experience with smart solutions. Milan is always happy to connect, work on new ideas, and explore the latest in technology. Costea Adrian Costea Adrian Embedded Engineer specilizing in perception systems. Latest project was a adas camera calibration system. Caio Rodrigues Caio Rodrigues I'm a full-stack developer focused on building practical and scalable web applications. My main experience is with **React, TypeScript, and modern frontend architectures**, where I prioritize clean code, component reusability, and maintainable project structures. I have strong experience working with **dynamic forms, state management (Redux / React Hook Form), and complex data-driven interfaces**. I enjoy solving real-world problems by turning ideas into reliable software that companies can actually use in their daily operations. Beyond coding, I care about **software quality and architecture**, following best practices for componentization, code organization, and performance optimization. I'm also comfortable working across the stack when needed, integrating APIs, handling business logic, and helping transform prototypes into production-ready systems. My goal is always to deliver solutions that are **simple, efficient, and genuinely useful for the people using them.** BurnHavoc BurnHavoc Been around fixing other peoples code for 20 years. Yovel Cohen Yovel Cohen I got a lot of experience in building Long-horizon AI Agents in production, Backend apps that scale to millions of users and frontend knowledge as well. Jacek Rozanski Jacek Rozanski Senior PHP/Symfony developer and DevOps engineer with 20+ years of professional experience, running opcode.pl (web development agency, est. 2004). Day job: I'm the sole backend developer at merketing company where I own and maintain 11 PHP/Symfony microservices on AWS (ECS Fargate, RDS, S3, CloudFront), handle the full CI/CD pipeline (Bitbucket Pipelines, Docker), and manage monitoring with Sentry and CloudWatch. These services handle high request volumes in production every month. What I bring to AI-built apps: - I audit and fix security issues (OWASP methodology), performance bottlenecks, and architectural problems in codebases generated by Cursor, Claude Code, Lovable, Bolt, and v0 - I refactor AI-generated prototypes into production-grade applications with proper error handling, testing, and clean architecture (SOLID, DDD, hexagonal architecture) - I set up the infrastructure AI tools don't touch: AWS hosting, CI/CD pipelines, automated deployments, database optimization, monitoring, and alerting - I integrate external services: payment providers, email systems, partner APIs, SSO/auth Tech stack: PHP 8.x, Symfony, React, Next.js, PostgreSQL, MySQL, Docker, AWS (ECS, RDS, S3, SQS/SNS, CloudFront), Terraform, Supabase. I also use AI tools daily (Claude Code, Cursor) in my own workflow, so I understand both the strengths and the gaps in AI-generated code. Based in Poland (CET timezone). Available for async work and calls during EU/US business hours. Antriksh Narang Antriksh Narang 5 years+ Experienced Dev (Specially in Web Development), can help in python, javascript, react, next.js and full stack web dev technologies. legrab legrab I'll fill this later

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

Why don't my linked records show up in Base44?

Make sure you're using Base44's relation field type, not a plain text field. The relation field type automatically handles the linking and display of related records.

How do I fix orphaned records in Base44?

Orphaned records occur when a referenced record is deleted. You may need to clean up the orphaned references manually or set up cascade rules to handle deletions automatically.

Related Base44 Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help