Skip to content

Create database schema for Auto ON/OFF #270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tracked by #850
misskniss opened this issue Feb 11, 2022 · 1 comment
Closed
Tracked by #850

Create database schema for Auto ON/OFF #270

misskniss opened this issue Feb 11, 2022 · 1 comment
Assignees
Labels
api Area: HTTP API
Milestone

Comments

@misskniss
Copy link

misskniss commented Feb 11, 2022

  • Cleanup: remove column workspace_auto_off from table organizations

  • Add columns to table workspace

    • autostart_enabled:bool default false
    • autostop_enabled:bool default false
    • autostart_at:timestamp with time zone default '0001-01-01- 00:00:00+00::timestamptz NOTE: this will include the user’s timezone
    • autostop_at:timestamp with time zone default '0001-01-01- 00:00:00+00::timestamptz NOTE: this will include the user’s timezone
  • Add methods to querier.go:

    • SetWorkspaceAutoStartEnabled(ctx context.Context, workspaceid string, when time.Time) error
    • SetWorkspaceAutoStartDisabled(ctx context.Context, workspaceid string) error
    • SetWorkspaceAutoStopEnabled(ctx context.Context, workspaceid string, when time.Time) error
    • SetWorkspaceAutoStopDisabled(ctx context.Context, workspaceid string) error
  • Changes:

    • Instead of a time.Time, will use a crontab-style representation for schedules. See create cron-style library or wrapper for workspace autostart / autostop #817.
    • autostart_at and autostop_at will be renamed autostart_schedule and autostop_schedule respectively.
    • autostart_schedule and autostop_schedule will allow NULL values, allowing autostart_enabled and autostop_enabled to be removed.
    • We only need the UpdateWorkspaceAutostart and UpdateWorkspaceAutostop methods, passing nil as the schedule can be semantically equivalent to DisableWorkspaceAuto{Stop,Start}.
@johnstcn
Copy link
Member

johnstcn commented Apr 7, 2022

Fixed by #879

@johnstcn johnstcn closed this as completed Apr 7, 2022
@misskniss misskniss mentioned this issue Apr 11, 2022
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Area: HTTP API
Projects
None yet
Development

No branches or pull requests

3 participants