diff --git a/.taskfiles/migrate-tasks.yml b/.taskfiles/migrate-tasks.yml deleted file mode 100644 index 5da3a77..0000000 --- a/.taskfiles/migrate-tasks.yml +++ /dev/null @@ -1,39 +0,0 @@ -version: "3" -tasks: - inspect: - desc: "Inspects the database schema and prints to stdout" - cmd: > - atlas schema inspect - --url "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}?sslmode=disable&search_path=public" - --format {{`'{{ sql . " " }}'`}} - - inspect-write: - desc: "Inspects the database schema and writes to a file" - cmd: > - atlas schema inspect - --url "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${DEV_POSTGRES_PORT}/${POSTGRES_DB}?sslmode=disable&search_path=public" - --format {{`'{{ sql . " " }}'`}} | tee db/schema.sql - - plan: - desc: "Applies current migrations to clean environment (--dev-url). Then compares it to the dev db (--to) and creates a migration plan" - cmd: > - atlas migrate diff - --dir "file://db/migrations" - --dev-url "docker://postgres/16/dev?search_path=public" - --to "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${DEV_POSTGRES_PORT}/${POSTGRES_DB}?sslmode=disable&search_path=public" - --format {{`'{{ sql . " " }}'`}} - - create-baseline: - desc: "Creates an initial baseline migration using a clean environment (--dev-url) compared to desired state (--to)" - cmd: > - atlas migrate diff baseline - --dev-url "docker://postgres/16/dev?search_path=public" - --to "file://db/schema.sql" - --dir "file://db/migrations" - - apply: - desc: "Applies the migration plan" - cmd: > - atlas migrate apply - --dir "file://db/migrations" - --url "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}?sslmode=disable&search_path=public" \ No newline at end of file diff --git a/.taskfiles/sqlc-tasks.yml b/.taskfiles/sqlc-tasks.yml deleted file mode 100644 index f630c59..0000000 --- a/.taskfiles/sqlc-tasks.yml +++ /dev/null @@ -1,5 +0,0 @@ -version: "3" -tasks: - generate: - desc: "Runs SQLc generation" - cmd: sqlc -f db/sqlc.yaml generate \ No newline at end of file diff --git a/controller/internal/config/config.go b/controller/internal/config/config.go index b4b9d93..9b055dd 100644 --- a/controller/internal/config/config.go +++ b/controller/internal/config/config.go @@ -24,6 +24,9 @@ type Zone struct { Schedule []ScheduleItem `json:"schedule"` } +// Weekdays is a uint8 where each bit represents a day of the week +// starting with Sunday at the LSB. The MSB is not used. For example, +// 0 0 1 0 1 0 1 0 means that Monday, Wednesday, and Friday are enabled type ScheduleItem struct { StartTime string `json:"startTime"` DurationMinutes int `json:"durationMinutes"`