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 9035229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:42:22+00:00 2026-06-16T08:42:22+00:00

I need to model an smtp server configuration for various entities that can send

  • 0

I need to model an smtp server configuration for various entities that can send email, so I have a table with the settings for an smtp server.

For example: entities that send email are “rooms” and “servers” — they live in separate tables since they have little in common, but they each refer to an optional email configuration.

While it is simple to have a SmtpConfigId in both the rooms and servers table, I cannot see how to have a cascading delete where, if the room or server is deleted, then its corresponding smtp configuration is also deleted.

Of course, I could replicate the smtp configuration fields for each entity table that can send an email, I think that the business logic for sending mail would be simplified if the email config is in its own table.

In addition to the email configuration, which is 1:1 between entities that send email, and their smtp configuration, there is also the question of form letters, which is 1:M, and I would also like a cascading delete to clean up the form letters if the entity that created them is deleted.

Am I thinking about this problem in the right way, and what is a good way to model it? on delete triggers?

  • 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-16T08:42:23+00:00Added an answer on June 16, 2026 at 8:42 am

    I would consider modeling as a polymorphic relationship with one table being used for the config stuff with a smtp_type field to distinguish the types (room, server, etc.).

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

Sidebar

Related Questions

I need to model a postal address that can have multiline street address, the
I need to model organizational hierarchy structure in my entities. An organization can be
I have a need for a model(?) on my app which basically contains a
I need to figure out a way to set ValidateRequest at model...I understand that
I have a prototype model where I need to include the following extension methods
I need a model for finding all of the regular expressions that would match
I need to model Owners and Rentees in an application, so you have stuff
i need to model the following scenario, but I can't get it working with
I'm using Rails 3 to create a project that will need a model called
I have the following Django model: created=models.DateTimeField(auto_now_add=True) I now need a model object method

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.