# Shift patterns in schedules configuration

**URL:** <https://forum.inductiveautomation.com/t/shift-patterns-in-schedules-configuration/70157>\
**Category:** Ignition\
**Created:** [February 22, 2023, 9:16am UTC](https://forum.inductiveautomation.com/t/shift-patterns-in-schedules-configuration/70157 "2023-02-22T09:16:13Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 22, 2023, 12:27pm UTC](https://forum.inductiveautomation.com/t/shift-patterns-in-schedules-configuration/70157/2 "2023-02-22T12:27:47Z")

</div>

When you have complex patterns, you generally need a complex solution. See this topic for working code that implements a generic solution for _ **any** _ repeating shift schedule:

> [@Script for periodically changing shift time](https://forum.inductiveautomation.com/t/script-for-periodically-changing-shift-time/51058/3):
>
> Hi Berkay, I like to solve this kind of problem with a smart database, like PostgreSQL, where I can define a pattern and repeat it with table generating functions. I tweaked one of my implementations to serve as an example: create table shift\_schedules (shift\_id serial, shift\_name varchar(255), refdate date, repeat int, tzname varchar(255), primary key (shift\_id)); insert into shift\_schedules (shift\_name, refdate, repeat, tzname) values ('Berkay Cinar 3wk', '2021-07-26', 21, 'America/Ne…

If you aren't using PostgreSQL, you will have to substitute other ways to use table-returning functions. (Good luck with that.)

---

_[View the full topic](https://forum.inductiveautomation.com/t/shift-patterns-in-schedules-configuration/70157)._
