I have a table Schedule like this
ID | FROM | TO | day of week
1 | 12/10/2016 | 01/03/2017 | 2
2 | 10/12/2016 | 10/15/2017 | 7
3 | 10/14/2016 | 10/20/2017 | 1
4 | 01/20/2016 | 01/30/2017 | 5
5 | 11/25/2016 | 01/30/2017 | 3
6 | 11/29/2016 | 01/30/2017 | 3
I need to create a trigger: after each insert, another table (single_date) needs to be updated with the translation of the inserted row.
For example first row means: every Tuesday between 12/10/2016 and 01/01/2017
and single_date table should update with the following rows
ID | schedule_ID | date
1 | 1 | 12/13/2016
2 | 1 | 12/20/2016
3 | 1 | 12/27/2016
4 | 1 | 01/03/2017