Gisle Aune
1 year ago
13 changed files with 167 additions and 46 deletions
-
9entities/sprint.go
-
3frontend/src/lib/components/scope/SprintBody.svelte
-
5frontend/src/lib/modals/SprintCreateUpdateModal.svelte
-
3frontend/src/lib/models/sprint.ts
-
1models/sprint.go
-
19ports/mysql/db.go
-
4ports/mysql/items.go
-
1ports/mysql/mysqlcore/models.go
-
69ports/mysql/mysqlcore/sprint.sql.go
-
62ports/mysql/queries/sprint.sql
-
5ports/mysql/sprint.go
-
9scripts/goose-mysql/20221120155110_sprint_tags.sql
-
23usecases/sprints/service.go
@ -1,50 +1,70 @@ |
|||||
-- name: ListSprintsAt :many |
-- name: ListSprintsAt :many |
||||
SELECT * FROM sprint WHERE scope_id = ? AND from_time <= sqlc.arg(time) AND to_time > sqlc.arg(time); |
|
||||
|
SELECT * |
||||
|
FROM sprint |
||||
|
WHERE scope_id = ? |
||||
|
AND from_time <= sqlc.arg(time) |
||||
|
AND to_time > sqlc.arg(time); |
||||
|
|
||||
-- name: ListSprintsBetween :many |
-- name: ListSprintsBetween :many |
||||
SELECT * FROM sprint |
|
||||
|
SELECT * |
||||
|
FROM sprint |
||||
WHERE scope_id = sqlc.arg(scope_id) |
WHERE scope_id = sqlc.arg(scope_id) |
||||
AND from_time < sqlc.arg(to_time) |
AND from_time < sqlc.arg(to_time) |
||||
AND to_time >= sqlc.arg(from_time) |
AND to_time >= sqlc.arg(from_time) |
||||
ORDER BY from_time, name; |
ORDER BY from_time, name; |
||||
|
|
||||
-- name: GetSprint :one |
-- name: GetSprint :one |
||||
SELECT * FROM sprint WHERE id = ? AND scope_id = ?; |
|
||||
|
SELECT * |
||||
|
FROM sprint |
||||
|
WHERE id = ? |
||||
|
AND scope_id = ?; |
||||
|
|
||||
-- name: InsertSprint :execresult |
-- name: InsertSprint :execresult |
||||
INSERT INTO sprint ( |
|
||||
scope_id, name, description, kind, from_time, to_time, |
|
||||
is_timed, is_coarse, aggregate_name, aggregate_required, is_unweighted |
|
||||
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); |
|
||||
|
INSERT INTO sprint (scope_id, name, description, kind, from_time, to_time, |
||||
|
is_timed, is_coarse, aggregate_name, aggregate_required, |
||||
|
is_unweighted, tags_csv) |
||||
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); |
||||
|
|
||||
-- name: UpdateSprint :exec |
-- name: UpdateSprint :exec |
||||
UPDATE sprint |
UPDATE sprint |
||||
SET name = ?, |
|
||||
description = ?, |
|
||||
from_time = ?, |
|
||||
to_time = ?, |
|
||||
is_timed = ?, |
|
||||
is_coarse = ?, |
|
||||
is_unweighted = ?, |
|
||||
aggregate_name = ?, |
|
||||
aggregate_required = ? |
|
||||
|
SET name = ?, |
||||
|
description = ?, |
||||
|
from_time = ?, |
||||
|
to_time = ?, |
||||
|
is_timed = ?, |
||||
|
is_coarse = ?, |
||||
|
is_unweighted = ?, |
||||
|
aggregate_name = ?, |
||||
|
aggregate_required = ?, |
||||
|
tags_csv = ? |
||||
WHERE id = ?; |
WHERE id = ?; |
||||
|
|
||||
-- name: DeleteSprint :exec |
-- name: DeleteSprint :exec |
||||
DELETE FROM sprint WHERE id = ?; |
|
||||
|
DELETE |
||||
|
FROM sprint |
||||
|
WHERE id = ?; |
||||
|
|
||||
-- name: DeleteAllScopeSprints :exec |
-- name: DeleteAllScopeSprints :exec |
||||
DELETE FROM sprint WHERE scope_id = ?; |
|
||||
|
DELETE |
||||
|
FROM sprint |
||||
|
WHERE scope_id = ?; |
||||
|
|
||||
-- name: ListSprintParts :many |
-- name: ListSprintParts :many |
||||
SELECT * FROM sprint_part WHERE sprint_id = ?; |
|
||||
|
SELECT * |
||||
|
FROM sprint_part |
||||
|
WHERE sprint_id = ?; |
||||
|
|
||||
-- name: ReplaceSprintPart :exec |
-- name: ReplaceSprintPart :exec |
||||
REPLACE INTO sprint_part (sprint_id, object_id, required) |
REPLACE INTO sprint_part (sprint_id, object_id, required) |
||||
VALUES (?, ?, ?); |
VALUES (?, ?, ?); |
||||
|
|
||||
-- name: DeleteSprintPart :exec |
-- name: DeleteSprintPart :exec |
||||
DELETE FROM sprint_part WHERE sprint_id = ? AND object_id = ?; |
|
||||
|
DELETE |
||||
|
FROM sprint_part |
||||
|
WHERE sprint_id = ? |
||||
|
AND object_id = ?; |
||||
|
|
||||
-- name: DeleteAllSprintParts :exec |
-- name: DeleteAllSprintParts :exec |
||||
DELETE FROM sprint_part WHERE sprint_id = ?; |
|
||||
|
DELETE |
||||
|
FROM sprint_part |
||||
|
WHERE sprint_id = ?; |
@ -0,0 +1,9 @@ |
|||||
|
-- +goose Up |
||||
|
-- +goose StatementBegin |
||||
|
ALTER TABLE sprint ADD COLUMN tags_csv VARCHAR(1024) NULL; |
||||
|
-- +goose StatementEnd |
||||
|
|
||||
|
-- +goose Down |
||||
|
-- +goose StatementBegin |
||||
|
ALTER TABLE sprint DROP COLUMN tags_csv; |
||||
|
-- +goose StatementEnd |
Write
Preview
Loading…
Cancel
Save
Reference in new issue