Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8178939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:53:15+00:00 2026-06-06T23:53:15+00:00

I have a database design problem which I have been researching for a while

  • 0

I have a database design problem which I have been researching for a while but cannot get a proper answer. Let’s say we have two tables, house_schema and house as follows:

house_schema {
      id big int,
      house_height int,
      house_width int,
      house_decoration vchar(1024),
      build_date  timestamp,
      primary key id,
}

house {
      id big int,
      owner vchar(255),
      price big int,
      house_schema_id big int,
      primary key id,
      foreign key fk_house_house_schema_id (`house_schema_id`) reference `house_schema`.`id`
}

The house_schema table stores some physical attributes of house. On a software UI, users select a schema then click a “build” button. A house is built and is stored in house. There are some other tables like house_schema to describe how a house should be built.

In a simple design, a foreign key seemingly works well. However, it gives rise to a problem when the builder decides to remove a schema that they think is out of date. There are already some houses built from the schema and the foreign key prevents it from deleting. If we change the foreign key to DELETE ON CASCADE, then those houses lose the information it was built from.

What’s the best design pattern to handle this problem? What I can imagine is having a duplicate table of house_schema, once a house has been built, copy the row in house_schema to the duplicate table.

But, this leads to a lot of duplicate tables in the database as I have multiple similar tables with house_schema. It seems to violate database normalization rules.

Does anybody have a good idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T23:53:16+00:00Added an answer on June 6, 2026 at 11:53 pm

    If you like to retain a history of what schema’s were used to build houses, a typical solution would be to implement a soft delete on your house_schema table.

    Instead of actually deleting the rows in house_schema you would have to

    • add a Active column to the table
    • set this column to false when a schema is obsolete
    • adjust your application to not show the inactive schema’s

    Note that there’s quite some material about soft delete, both advising against and for.

    • Are soft deletes a good idea
    • The trouble with soft delete
    • Soft deletes are bad?

    From personal experience, we employ soft delete on selectable items (drop down lists) in our main application without any mentionable problems so far.

    When an item becomes obsolete, it’s value needs to be retained wherever it’s used but for new documents, it shouldn’t show up in de drop down lists anymore. I yet have to come across a better solution to be able to handle this scenario other than soft delete.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say i have a database design like this: for the data: id |
I have design problem, which I would love to get a hand with. I
I have some transitive dependencies in my database design. I have been told by
I have to design a database which will allow me store data in multiple
I have a database design that's normalized well enough, but now I need to
I am having problems displaying images which have been queried from the database. The
I'm building a Wine review site and have run into a database design problem
Just a general database design question - no programming, but a bit of problem
Good day all, I have been learning about databases and database design and I
For you database design/performance gurus out there. If you have a database that is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.