Compare commits

...

3 Commits

Author SHA1 Message Date
brian 95e93bcf41 adding foreign key references 2026-05-21 13:55:17 -06:00
brian 688a1f90d2 bunch of migration files, iteration 1 2026-05-21 13:47:43 -06:00
brian 80b488008d fixing font awesome stuff 2026-05-21 10:24:25 -06:00
21 changed files with 324 additions and 12 deletions
@@ -0,0 +1,34 @@
-- internal/db/migrations/2026_00_00_000000_create_audit_log_table.sql
-- CREATE TABLE "audit_log" ------------------------------------
CREATE TABLE IF NOT EXISTS "audit_log" (
"id" Integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"created_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP,
"initiated_by" Integer NOT NULL REFERENCES "users"("id"),
"webhook_action" Boolean NOT NULL DEFAULT FALSE,
"resource_type" Text NOT NULL,
"resource_id" Integer NOT NULL,
"action_type" Text NOT NULL,
"summary" Text,
"previous_values" Text,
"new_values" Text
);
-- -------------------------------------------------------------
-- CREATE INDEX "idx_audit_resource" ---------------------------
CREATE INDEX IF NOT EXISTS "idx_audit_resource"
ON "audit_log" ( "resource_type", "resource_id" )
;
-- -------------------------------------------------------------
-- CREATE INDEX "idx_audit_initiator" --------------------------
CREATE INDEX IF NOT EXISTS "idx_audit_initiator"
ON "audit_log" ( "initiated_by", "created_at" )
;
-- -------------------------------------------------------------
-- CREATE INDEX "idx_audit_created" ----------------------------
CREATE INDEX IF NOT EXISTS "idx_audit_created"
ON "audit_log" ( "created_at" )
;
-- -------------------------------------------------------------
@@ -0,0 +1,39 @@
-- internal/db/migrations/2026_01_01_000000_create_users_table.sql
-- CREATE TABLE "users" ----------------------------------------
CREATE TABLE IF NOT EXISTS "users" (
"id" Integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"username" Text NOT NULL,
"is_admin" Boolean DEFAULT FALSE,
"name" Text NOT NULL,
"email" Text NOT NULL,
"password" Text,
"avatar_url" Text,
"provider" Text NOT NULL DEFAULT 'local',
"provider_id" Text,
"created_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" DateTime,
"deleted_at" DateTime,
CONSTRAINT "unique_username" UNIQUE ( username ),
CONSTRAINT "unique_email" UNIQUE ( email ) );
-- -------------------------------------------------------------
-- CREATE INDEX "idx_users_provider" ---------------------------
CREATE UNIQUE INDEX IF NOT EXISTS "idx_users_provider"
ON "users"( "provider", "provider_id" )
WHERE "provider_id" IS NOT NULL;
-- -------------------------------------------------------------
-- INSERT "SYSTEM" USER ----------------------------------------
INSERT INTO `users`
(`username`,`is_admin`,`name`,`email`,`avatar_url`)
VALUES
("system", true, "System User", "system@localhost", "")
-- -------------------------------------------------------------
-- INSERT "ZOMBIE" USER ----------------------------------------
INSERT INTO `users`
(`username`,`is_admin`,`name`,`email`,`avatar_url`)
VALUES
("zombie", false, "Zombie", "zombie@localhost", "")
-- -------------------------------------------------------------
@@ -0,0 +1,20 @@
-- internal/db/migrations/2026_01_01_000010_create_projects_table.sql
-- CREATE TABLE "projects" ------------------------------------
CREATE TABLE IF NOT EXISTS "projects"(
"id" Integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"creator_id" Integer NOT NULL REFERENCES "users"("id"),
"owner_id" Integer NOT NULL REFERENCES "users"("id"),
"git_repository_url" Text,
"title" Text NOT NULL,
"description" Text,
"status" Text,
"priority" Text,
"start_date" DateTime,
"target_date" DateTime,
"completed_at" DateTime,
"created_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" DateTime,
"deleted_at" DateTime
);
-- -------------------------------------------------------------
@@ -0,0 +1,12 @@
-- internal/db/migrations/2026_01_01_000011_create_project_user_table.sql
-- CREATE TABLE "project_user" ---------------------------------
CREATE TABLE IF NOT EXISTS "project_user" (
"project_id" Integer NOT NULL REFERENCES "projects"("id"),
"user_id" Integer NOT NULL REFERENCES "users"("id"),
"invited_by_user_id" Integer REFERENCES "users"("id"),
"role" Text NOT NULL DEFAULT 'member',
"created_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP,
"deleted_at" DateTime,
CONSTRAINT "idx_project_user" UNIQUE ( project_id, user_id ) );
-- -------------------------------------------------------------
@@ -0,0 +1,13 @@
-- internal/db/migrations/2026_01_01_000011_create_project_labels_table.sql
-- CREATE TABLE "project_labels" -------------------------------
CREATE TABLE IF NOT EXISTS "project_labels" (
"id" Integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"project_id" Integer NOT NULL REFERENCES "projects"("id"),
"user_id" Integer NOT NULL REFERENCES "users"("id"),
"label" Text NOT NULL,
"color" Text NOT NULL DEFAULT '#42f5ce',
"created_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP,
"deleted_at" DateTime,
CONSTRAINT "idx_project_labels" UNIQUE ( project_id, label ) );
-- -------------------------------------------------------------
@@ -0,0 +1,12 @@
-- internal/db/migrations/2026_01_01_000013_create_project_links_table.sql
-- CREATE TABLE "project_links" --------------------------------
CREATE TABLE IF NOT EXISTS "project_links" (
"id" Integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"project_id" Integer NOT NULL REFERENCES "projects"("id"),
"user_id" Integer NOT NULL REFERENCES "users"("id"),
"remote_url" Text NOT NULL,
"created_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP,
"deleted_at" DateTime
);
-- -------------------------------------------------------------
@@ -0,0 +1,15 @@
-- internal/db/migrations/2026_01_01_000014_create_project_attachments_table.sql
-- CREATE TABLE "project_attachments" --------------------------
CREATE TABLE IF NOT EXISTS "project_attachments" (
"id" Integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"project_id" Integer NOT NULL REFERENCES "projects"("id"),
"user_id" Integer NOT NULL REFERENCES "users"("id"),
"path" TEXT NOT NULL,
"preview_path" TEXT NOT NULL,
"filesize" Integer NOT NULL DEFAULT 0,
"mimetype" TEXT NOT NULL,
"created_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP,
"deleted_at" DateTime
);
-- -------------------------------------------------------------
@@ -0,0 +1,12 @@
-- internal/db/migrations/2026_01_01_000015_create_project_favorites_table.sql
-- CREATE TABLE "project_favorites" ----------------------------
CREATE TABLE IF NOT EXISTS "project_favorites" (
"id" Integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"project_id" Integer NOT NULL REFERENCES "projects"("id"),
"user_id" Integer NOT NULL REFERENCES "users"("id"),
"favorited_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP,
"deleted_at" DateTime,
CONSTRAINT "idx_project_user" UNIQUE ( project_id, user_id ) );
-- -------------------------------------------------------------
@@ -0,0 +1,11 @@
-- internal/db/migrations/2026_01_00_000007_create_project_dependencies_table.sql
-- CREATE TABLE "project_dependencies" -----------------------------
CREATE TABLE IF NOT EXISTS "project_dependencies" (
"source_project_id" Integer NOT NULL REFERENCES "projects"("id"),
"blocking_project_id" Integer NOT NULL REFERENCES "projects"("id"),
"created_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "idx_dependant_project" UNIQUE ( source_project_id, blocking_project_id )
);
-- -------------------------------------------------------------
@@ -0,0 +1,35 @@
-- internal/db/migrations/2026_01_01_000020_create_issues_table.sql
-- CREATE TABLE "issues" ---------------------------------------
CREATE TABLE IF NOT EXISTS "issues" (
"id" Integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"creator_id" Integer NOT NULL REFERENCES "users"("id"),
"assignee_id" Integer REFERENCES "users"("id"),
"project_id" Integer NOT NULL REFERENCES "projects"("id"),
"project_issue_id" Integer NOT NULL,
"title" Text,
"description" Text,
"status" Text,
"priority" Text,
"start_date" DateTime,
"target_date" DateTime,
"completed_at" DateTime,
"parent_issue_id" Integer REFERENCES "issues"("id"),
"created_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" DateTime,
"deleted_at" DateTime,
CONSTRAINT "uni_project_issue_id" UNIQUE ( project_id, project_issue_id )
);
-- -------------------------------------------------------------
-- CREATE INDEX "index_creator_id" -----------------------------
CREATE INDEX IF NOT EXISTS "index_creator_id" ON "issues"( "creator_id" );
-- -------------------------------------------------------------
-- CREATE INDEX "index_project_id" -----------------------------
CREATE INDEX IF NOT EXISTS "index_project_id" ON "issues"( "project_id" );
-- -------------------------------------------------------------
-- CREATE INDEX "index_assignee_id" ----------------------------
CREATE INDEX IF NOT EXISTS "index_assignee_id" ON "issues"( "assignee_id" );
-- -------------------------------------------------------------
@@ -0,0 +1,12 @@
-- internal/db/migrations/2026_01_01_000021_create_issue_labels_table.sql
-- CREATE TABLE "issue_labels" ---------------------------------
CREATE TABLE IF NOT EXISTS "issue_labels" (
"id" Integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"issue_id" Integer NOT NULL REFERENCES "issues"("id"),
"project_label_id" Integer NOT NULL REFERENCES "project_labels"("id"),
"user_id" Integer NOT NULL REFERENCES "users"("id"),
"created_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP,
"deleted_at" DateTime,
CONSTRAINT "idx_issue_labels" UNIQUE ( issue_id, project_label_id ) );
-- -------------------------------------------------------------
@@ -0,0 +1,12 @@
-- internal/db/migrations/2026_01_01_000022_create_issue_links_table.sql
-- CREATE TABLE "issue_links" ----------------------------------
CREATE TABLE IF NOT EXISTS "issue_links" (
"id" Integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"issue_id" Integer NOT NULL REFERENCES "issues"("id"),
"user_id" Integer NOT NULL REFERENCES "users"("id"),
"remote_url" Text NOT NULL,
"created_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP,
"deleted_at" DateTime
);
-- -------------------------------------------------------------
@@ -0,0 +1,15 @@
-- internal/db/migrations/2026_01_01_000023_create_issue_attachments_table.sql
-- CREATE TABLE "issue_attachments" ----------------------------
CREATE TABLE IF NOT EXISTS "issue_attachments" (
"id" Integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"issue_id" Integer NOT NULL REFERENCES "issues"("id"),
"user_id" Integer NOT NULL REFERENCES "users"("id"),
"path" TEXT NOT NULL,
"preview_path" TEXT NOT NULL,
"filesize" Integer NOT NULL DEFAULT 0,
"mimetype" TEXT NOT NULL,
"created_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP,
"deleted_at" DateTime
);
-- -------------------------------------------------------------
@@ -0,0 +1,11 @@
-- internal/db/migrations/2026_01_01_000005_create_issue_blockers_table.sql
-- CREATE TABLE "issue_blockers" -------------------------------
CREATE TABLE IF NOT EXISTS "issue_blockers" (
"source_issue_id" Integer NOT NULL REFERENCES "issues"("id"),
"blocking_issue_id" Integer NOT NULL REFERENCES "issues"("id"),
"created_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "idx_blocking_issue" UNIQUE ( source_issue_id, blocking_issue_id )
);
-- -------------------------------------------------------------
@@ -0,0 +1,14 @@
-- internal/db/migrations/2026_01_01_000024_create_issue_comments_table.sql
-- CREATE TABLE "issue_comments" -------------------------------
CREATE TABLE IF NOT EXISTS "issue_comments" (
"id" Integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"issue_id" Integer NOT NULL REFERENCES "issues"("id"),
"user_id" Integer NOT NULL REFERENCES "users"("id"),
"body" TEXT NOT NULL,
"created_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" DateTime,
"resolved_at" DateTime,
"deleted_at" DateTime
);
-- -------------------------------------------------------------
@@ -0,0 +1,13 @@
-- internal/db/migrations/2026_01_01_000106_create_issue_comment_links_table.sql
-- CREATE TABLE "issue_comment_links" --------------------------
CREATE TABLE IF NOT EXISTS "issue_comment_links" (
"id" Integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"issue_comment_id" Integer NOT NULL REFERENCES "issue_comments"("id"),
"user_id" Integer NOT NULL REFERENCES "users"("id"),
"remote_url" Text NOT NULL,
"created_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP,
"deleted_at" DateTime
);
-- -------------------------------------------------------------
@@ -0,0 +1,16 @@
-- internal/db/migrations/2026_01_01_000107_create_issue_comment_attachments_table.sql
-- CREATE TABLE "issue_comment_attachments" --------------------------
CREATE TABLE IF NOT EXISTS "issue_comment_attachments" (
"id" Integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"issue_comment_id" Integer NOT NULL REFERENCES "issue_comments"("id"),
"user_id" Integer NOT NULL REFERENCES "users"("id"),
"path" TEXT NOT NULL,
"preview_path" TEXT NOT NULL,
"filesize" Integer NOT NULL DEFAULT 0,
"mimetype" TEXT NOT NULL,
"created_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP,
"deleted_at" DateTime
);
-- -------------------------------------------------------------
@@ -0,0 +1,16 @@
-- internal/db/migrations/2026_01_02_000001_create_webhook_receipts_table.sql
-- CREATE TABLE "webhook_receipts" -------------------------------
CREATE TABLE IF NOT EXISTS "webhook_receipts" (
"id" Integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"raw_payload" Text NOT NULL,
"source" Text NOT NULL,
"event_type" Text NOT NULL,
"delivery_id" Text NOT NULL,
"received_at" DateTime NOT NULL DEFAULT CURRENT_TIMESTAMP,
"processing_status" Text NOT NULL DEFAULT 'pending',
"failure_reason" Text,
CONSTRAINT "unique_delivery_id" UNIQUE ( delivery_id )
);
-- -------------------------------------------------------------
+10 -10
View File
@@ -6379,7 +6379,7 @@ readers do not read off random characters that represent icons */
font-style: normal;
font-weight: 400;
font-display: block;
src: url("../webfonts/fa-brands-400.woff2") format("woff2"), url("../webfonts/fa-brands-400.ttf") format("truetype"); }
src: url("webfonts/fa-brands-400.woff2") format("woff2"), url("webfonts/fa-brands-400.ttf") format("truetype"); }
.fab,
.fa-brands {
@@ -7896,7 +7896,7 @@ readers do not read off random characters that represent icons */
font-style: normal;
font-weight: 400;
font-display: block;
src: url("../webfonts/fa-regular-400.woff2") format("woff2"), url("../webfonts/fa-regular-400.ttf") format("truetype"); }
src: url("webfonts/fa-regular-400.woff2") format("woff2"), url("webfonts/fa-regular-400.ttf") format("truetype"); }
.far,
.fa-regular {
@@ -7910,7 +7910,7 @@ readers do not read off random characters that represent icons */
font-style: normal;
font-weight: 900;
font-display: block;
src: url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.ttf") format("truetype"); }
src: url("webfonts/fa-solid-900.woff2") format("woff2"), url("webfonts/fa-solid-900.ttf") format("truetype"); }
.fas,
.fa-solid {
@@ -7919,37 +7919,37 @@ readers do not read off random characters that represent icons */
font-family: 'Font Awesome 5 Brands';
font-display: block;
font-weight: 400;
src: url("../webfonts/fa-brands-400.woff2") format("woff2"), url("../webfonts/fa-brands-400.ttf") format("truetype"); }
src: url("webfonts/fa-brands-400.woff2") format("woff2"), url("webfonts/fa-brands-400.ttf") format("truetype"); }
@font-face {
font-family: 'Font Awesome 5 Free';
font-display: block;
font-weight: 900;
src: url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.ttf") format("truetype"); }
src: url("webfonts/fa-solid-900.woff2") format("woff2"), url("webfonts/fa-solid-900.ttf") format("truetype"); }
@font-face {
font-family: 'Font Awesome 5 Free';
font-display: block;
font-weight: 400;
src: url("../webfonts/fa-regular-400.woff2") format("woff2"), url("../webfonts/fa-regular-400.ttf") format("truetype"); }
src: url("webfonts/fa-regular-400.woff2") format("woff2"), url("webfonts/fa-regular-400.ttf") format("truetype"); }
@font-face {
font-family: 'FontAwesome';
font-display: block;
src: url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.ttf") format("truetype"); }
src: url("webfonts/fa-solid-900.woff2") format("woff2"), url("webfonts/fa-solid-900.ttf") format("truetype"); }
@font-face {
font-family: 'FontAwesome';
font-display: block;
src: url("../webfonts/fa-brands-400.woff2") format("woff2"), url("../webfonts/fa-brands-400.ttf") format("truetype"); }
src: url("webfonts/fa-brands-400.woff2") format("woff2"), url("webfonts/fa-brands-400.ttf") format("truetype"); }
@font-face {
font-family: 'FontAwesome';
font-display: block;
src: url("../webfonts/fa-regular-400.woff2") format("woff2"), url("../webfonts/fa-regular-400.ttf") format("truetype");
src: url("webfonts/fa-regular-400.woff2") format("woff2"), url("webfonts/fa-regular-400.ttf") format("truetype");
unicode-range: U+F003,U+F006,U+F014,U+F016-F017,U+F01A-F01B,U+F01D,U+F022,U+F03E,U+F044,U+F046,U+F05C-F05D,U+F06E,U+F070,U+F087-F088,U+F08A,U+F094,U+F096-F097,U+F09D,U+F0A0,U+F0A2,U+F0A4-F0A7,U+F0C5,U+F0C7,U+F0E5-F0E6,U+F0EB,U+F0F6-F0F8,U+F10C,U+F114-F115,U+F118-F11A,U+F11C-F11D,U+F133,U+F147,U+F14E,U+F150-F152,U+F185-F186,U+F18E,U+F190-F192,U+F196,U+F1C1-F1C9,U+F1D9,U+F1DB,U+F1E3,U+F1EA,U+F1F7,U+F1F9,U+F20A,U+F247-F248,U+F24A,U+F24D,U+F255-F25B,U+F25D,U+F271-F274,U+F278,U+F27B,U+F28C,U+F28E,U+F29C,U+F2B5,U+F2B7,U+F2BA,U+F2BC,U+F2BE,U+F2C0-F2C1,U+F2C3,U+F2D0,U+F2D2,U+F2D4,U+F2DC; }
@font-face {
font-family: 'FontAwesome';
font-display: block;
src: url("../webfonts/fa-v4compatibility.woff2") format("woff2"), url("../webfonts/fa-v4compatibility.ttf") format("truetype");
src: url("webfonts/fa-v4compatibility.woff2") format("woff2"), url("webfonts/fa-v4compatibility.ttf") format("truetype");
unicode-range: U+F041,U+F047,U+F065-F066,U+F07D-F07E,U+F080,U+F08B,U+F08E,U+F090,U+F09A,U+F0AC,U+F0AE,U+F0B2,U+F0D0,U+F0D6,U+F0E4,U+F0EC,U+F10A-F10B,U+F123,U+F13E,U+F148-F149,U+F14C,U+F156,U+F15E,U+F160-F161,U+F163,U+F175-F178,U+F195,U+F1F8,U+F219,U+F27A; }
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -66,7 +66,7 @@
href="/api/auth/gitea"
class="inline-flex items-center justify-center w-full px-6 py-2.5 font-bold text-center text-slate-700 uppercase transition-all ease-in bg-white border border-solid border-gray-300 rounded-lg shadow-soft-sm text-xs hover:shadow-soft-md hover:scale-102"
>
<i class="fas fa-code-branch mr-2 text-base"></i>
<i class="fab fa-git-alt mr-2 text-base"></i>
Sign in with Gitea
</a>
</div>