Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Database table design for scheduling tasks

I want to be able to create schedules that can be executed based on a fixed date, repeated daily, repeated on a particular day of the week, repeated on a particular month of the year, repeated on a particular date every year, and repeated at a particular time of the day.

Please how do i go about building the database tables for this problem?

Edit #1

Basically, i'm writing an application that allows users to schedule pre-configured greetings to be sent at various pre-configured times. I know i need a table that stores information about a schedule (ex. Christmas, Marketing One, ... | and when the schedule should run). Then another table to record what schedule has ran, what greeting it sent, to who, and what email; basically a transactions table.

My problem is designing the Schedule table because, i want to allow users run the schedule at a specific date, on a particular day of the week (recurring), on a particular day of every month, on a particular time everyday, and on a particular day/month (ex. 25/12) every year.

How can i create a set of tables for schedule that will take care of these inputs in flexible way?

like image 520
Orson Avatar asked Aug 23 '12 10:08

Orson


People also ask

What is Task Schedule table?

The TASK table contains the tasks that have been scheduled, but not yet purged. The primary key for this table is the TASKID which equates to the getTaskID() method on the com.

What is a scheduler database?

The Scheduler enables database administrators and application developers to control when and where various tasks take place in the database environment. These tasks can be time consuming and complicated, so using the Scheduler can help you to improve the management and planning of these tasks.

What is table design database?

Within a database, related data are grouped into tables, each of which consists of rows (also called tuples) and columns, like a spreadsheet. To convert your lists of data into tables, start by creating a table for each type of entity, such as products, sales, customers, and orders.


1 Answers

This is the table structure i came up with;

Schedule  - ScheduleName  - ScheduleTypeId (Daily, Weekly, Monthly, Yearly, Specific)  - StartDate  - IntervalInDays  - Frequency  - FrequencyCounter  ScheduleDaily  - ScheduleDailyId   - ScheduleId  - TimeOfDay  - StartDate  - EndDate  ScheduleMonthly  - ScheduleMonthlyId  - ScheduleId  - DayOfMonth  - StartDate  - EndDate  ScheduleSpecific  - ScheduleSpecificId  - ScheduleId  - SpecificDate  - StartDate  ...  ScheduleJob  - ScheduleJobId  - ScheduleId  - ScheduleTypeId  - RunDate  - ScheduleStatusId 
like image 92
Orson Avatar answered Sep 19 '22 15:09

Orson