A
A
Alexander2021-05-27 14:14:12
MySQL
Alexander, 2021-05-27 14:14:12

How to create a database to run commands on a schedule?

The question is how to implement a database with a launch schedule, one object can have as many launches per day according to the schedule, the schedule is tied only to the clock, let's say the script starts looking at the time, for example, 9:00 climbs into the database and sees what is needed now run according to the schedule, namely which objects have the time 9:00, takes them and launches them. Tell me how to build a schedule database architecture and preferably a compact structure

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Akina, 2021-05-27
@riki13

CREATE TABLE schedule ( schedule_id INT PRIMARY KEY,
                        start_time TIME,
                        task_id INT );

In one record - one time and one task. No CSV sets.
If the tasks have a separate table - then, accordingly, FOREIGN KEY in it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question