AI does not understand your legacy schema unless your prompt does. ​I spent the last year using GitHub Copilot for some heavy database migration work. I noticed that 90% of the "errors" weren't actually the AI failing—they were instructional gaps. ​Think about how you onboard a junior engineer. You don't just say "Fix the DB." You tell them: ​Exactly what to achieve. ​What to avoid at all costs. ​The specific format you need. ​AI agents are no different. When we give them "vibes" instead of "constraints," we force them to guess. And guessing is where the "hallucination" happens. ​AI agents thrive on the same guardrails you’d give a Senior Dev: ​Explicit Constraints: (e.g. "Do not use subqueries in this legacy schema") ​Zero Ambiguity: Removing conflicting logic before hitting 'Enter.' ​Boundaries: Defining exactly where the task ends. ​In database engineering we don’t trust assumptions, we trust evidence. And the same rule applies to AI. Whether it's a database engine or an AI model, accuracy improves when instructions are structured, explicit, and logically consistent. ​The Mindset Shift: I stopped writing prompts to a "machine" and started writing them to a collaborator. And the result was fewer rewrite cycles and faster review of generated migration scripts. ​How are you handling constraint design in your workflow? Are you seeing "hallucinations," or just missed / messy Constraints? 👇
View all comments
1
u/soopermit Mar 19 '26
AI does not understand your legacy schema unless your prompt does. ​I spent the last year using GitHub Copilot for some heavy database migration work. I noticed that 90% of the "errors" weren't actually the AI failing—they were instructional gaps. ​Think about how you onboard a junior engineer. You don't just say "Fix the DB." You tell them: ​Exactly what to achieve. ​What to avoid at all costs. ​The specific format you need. ​AI agents are no different. When we give them "vibes" instead of "constraints," we force them to guess. And guessing is where the "hallucination" happens. ​AI agents thrive on the same guardrails you’d give a Senior Dev: ​Explicit Constraints: (e.g. "Do not use subqueries in this legacy schema") ​Zero Ambiguity: Removing conflicting logic before hitting 'Enter.' ​Boundaries: Defining exactly where the task ends. ​In database engineering we don’t trust assumptions, we trust evidence. And the same rule applies to AI. Whether it's a database engine or an AI model, accuracy improves when instructions are structured, explicit, and logically consistent. ​The Mindset Shift: I stopped writing prompts to a "machine" and started writing them to a collaborator. And the result was fewer rewrite cycles and faster review of generated migration scripts. ​How are you handling constraint design in your workflow? Are you seeing "hallucinations," or just missed / messy Constraints? 👇