Skip to content
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

Add Poker and Retro default settings for teams #637

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,708 changes: 2,618 additions & 1,090 deletions docs/swagger/docs.go

Large diffs are not rendered by default.

3,708 changes: 2,618 additions & 1,090 deletions docs/swagger/swagger.json

Large diffs are not rendered by default.

1,084 changes: 1,007 additions & 77 deletions docs/swagger/swagger.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
-- +goose Up
-- +goose StatementBegin

CREATE TABLE thunderdome.poker_settings (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
organization_id UUID REFERENCES thunderdome.organization(id) ON DELETE CASCADE,
department_id UUID REFERENCES thunderdome.organization_department(id) ON DELETE CASCADE,
team_id UUID REFERENCES thunderdome.team(id) ON DELETE CASCADE,
auto_finish_voting BOOLEAN DEFAULT true,
point_average_rounding VARCHAR(5) DEFAULT 'ceil',
hide_voter_identity BOOLEAN DEFAULT false,
estimation_scale_id UUID REFERENCES thunderdome.estimation_scale(id),
join_code TEXT,
facilitator_code TEXT,
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT check_id_not_null CHECK (
num_nonnulls(organization_id, department_id, team_id) = 1
),
CONSTRAINT ps_unique_org_setting UNIQUE (organization_id),
CONSTRAINT ps_unique_dept_setting UNIQUE (department_id),
CONSTRAINT ps_unique_team_setting UNIQUE (team_id)
);

CREATE INDEX ON thunderdome.poker_settings (organization_id);
CREATE INDEX ON thunderdome.poker_settings (department_id);
CREATE INDEX ON thunderdome.poker_settings (team_id);

CREATE TABLE thunderdome.retro_settings (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
organization_id UUID REFERENCES thunderdome.organization(id) ON DELETE CASCADE,
department_id UUID REFERENCES thunderdome.organization_department(id) ON DELETE CASCADE,
team_id UUID REFERENCES thunderdome.team(id) ON DELETE CASCADE,
max_votes INT2 DEFAULT 3,
allow_multiple_votes BOOLEAN DEFAULT false,
brainstorm_visibility VARCHAR(12) DEFAULT 'visible',
phase_time_limit_min INT2 DEFAULT 0,
phase_auto_advance BOOLEAN DEFAULT false,
allow_cumulative_voting BOOLEAN DEFAULT false,
template_id UUID REFERENCES thunderdome.retro_template(id),
join_code TEXT,
facilitator_code TEXT,
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT check_id_not_null CHECK (
num_nonnulls(organization_id, department_id, team_id) = 1
),
CONSTRAINT rs_unique_org_setting UNIQUE (organization_id),
CONSTRAINT rs_unique_dept_setting UNIQUE (department_id),
CONSTRAINT rs_unique_team_setting UNIQUE (team_id)
);

CREATE INDEX ON thunderdome.retro_settings (organization_id);
CREATE INDEX ON thunderdome.retro_settings (department_id);
CREATE INDEX ON thunderdome.retro_settings (team_id);

-- +goose StatementEnd

-- +goose Down
-- +goose StatementBegin

DROP TABLE IF EXISTS thunderdome.poker_settings;
DROP TABLE IF EXISTS thunderdome.retro_settings;

-- +goose StatementEnd
Loading
Loading