Skip to content
Merged
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ require (
go.uber.org/fx v1.24.0
go.uber.org/zap v1.27.1
golang.org/x/crypto v0.49.0
golang.org/x/sync v0.20.0
)

require (
Expand Down Expand Up @@ -91,7 +92,6 @@ require (
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/mod v0.33.0 // indirect
golang.org/x/net v0.51.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/sys v0.43.0 // indirect
golang.org/x/text v0.35.0 // indirect
golang.org/x/tools v0.42.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions internal/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/bit-issues/backend/internal/jwt"
"github.com/bit-issues/backend/internal/projects"
"github.com/bit-issues/backend/internal/server"
"github.com/bit-issues/backend/internal/tasks"
"github.com/bit-issues/backend/internal/users"
"github.com/go-core-fx/bunfx"
"github.com/go-core-fx/fiberfx"
Expand Down Expand Up @@ -52,6 +53,7 @@ func Run(version healthfx.Version) {
jwt.Module(),
users.Module(),
projects.Module(),
tasks.Module(),
//
fx.Invoke(func(lc fx.Lifecycle, logger *zap.Logger) {
lc.Append(fx.Hook{
Expand Down
48 changes: 48 additions & 0 deletions internal/db/migrations/20260414000000_create_tasks.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE `tasks` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`project_slug` VARCHAR(255) NOT NULL,
`number` INT NOT NULL,
`title` VARCHAR(255) NOT NULL,
`description` TEXT,
`priority` ENUM(
'Trivial',
'Minor',
'Major',
'Critical',
'Blocker'
) NOT NULL DEFAULT 'Minor',
`status` ENUM(
'New',
'Open',
'In Progress',
'Resolved',
'Closed',
'Reopened'
) NOT NULL DEFAULT 'New',
`author_id` BIGINT UNSIGNED NOT NULL,
`assignee_id` BIGINT UNSIGNED,
`due_date` DATE,
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`deleted_at` DATETIME,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_tasks_project_number` (`project_slug`, `number`),
KEY `idx_tasks_author_id` (`author_id`),
KEY `idx_tasks_assignee_id` (`assignee_id`),
KEY `idx_tasks_status_priority` (`status`, `priority`),
KEY `idx_tasks_created_at` (`created_at`),
KEY `idx_tasks_due_date` (`due_date`),
KEY `idx_tasks_deleted_at` (`deleted_at`),
CONSTRAINT `fk_tasks_project` FOREIGN KEY (`project_slug`) REFERENCES `projects`(`id`) ON DELETE CASCADE,
CONSTRAINT `fk_tasks_author` FOREIGN KEY (`author_id`) REFERENCES `users`(`id`) ON DELETE RESTRICT,
CONSTRAINT `fk_tasks_assignee` FOREIGN KEY (`assignee_id`) REFERENCES `users`(`id`) ON DELETE
SET NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
-- +goose StatementEnd
---
Comment thread
capcom6 marked this conversation as resolved.
-- +goose Down
-- +goose StatementBegin
DROP TABLE `tasks`;
-- +goose StatementEnd
Loading
Loading