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

  • Home
  • SEARCH
  • 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 956341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:31:31+00:00 2026-05-16T00:31:31+00:00

I’m making an online calendar. One will be able to create en event and

  • 0

I’m making an online calendar.

One will be able to create en event and then have the possibility to choose to add “infinite” or “from” to “end” datetime. And if you choose to add a “from” to “end” you can choose it to be no repeat or repeat every day, every week or every month.

I wonder what is the best way to create these relations.

Here are my tables I’m having right now:

Table: Events
Columns: name, description, date_time (foreign key)

Table: Date_time
Columns: from, to, repeat (foreign key)

Table: Repeat
Columns: mode, days
1: "daily", "every 2nd day"
2: "weekly", "Monday, Wednesday"
3: "monthly", "1st, 12th, 19th"

With this I encounter some problems.

Here I have to specify an Events.date_time because it’s having a foreign key constraint. How can I let the user choose to not specify any datetime, just have it set to infinite.

And the same goes for Repeat. If the user has set a datetime I want to give the possibility to set the repeat to none.

Could someone point me into right direction.

Thanks

  • 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-05-16T00:31:32+00:00Added an answer on May 16, 2026 at 12:31 am

    I would suggest to reconsider the schema, my proposal is such:

    EDIT: since Event may have not more than one Period, it is better to use from and to as columns, if they are null then event is valid infinitely.

    Table: Events
    Columns: id, name, description, from (nullable), to (nullable)
    
    Table: Repeat
    Columns: mode, days, event_id (foreign key to Event)
    1: "daily", "every 2nd day"
    2: "weekly", "Monday, Wednesday"
    3: "monthly", "1st, 12th, 19th"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I have just tried to save a simple *.rtf file with some websites and
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I am trying to loop through a bunch of documents I have to put
I have some data like this: 1 2 3 4 5 9 2 6

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.