Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
Binary file added _issue-status-redesign/01_layouts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _issue-status-redesign/02_variants.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _issue-status-redesign/03_dropdown_status.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _issue-status-redesign/04_dropdown_compact.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _issue-status-redesign/05_issue_list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _issue-status-redesign/06_issue_detail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
471 changes: 471 additions & 0 deletions _issue-status-redesign/README.md

Large diffs are not rendered by default.

45 changes: 37 additions & 8 deletions drizzle/0000_init-schema.sql → drizzle/0000_initv2.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

CREATE TABLE "issue_comments" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"issue_id" uuid NOT NULL,
Expand All @@ -22,14 +21,17 @@ CREATE TABLE "issues" (
"title" text NOT NULL,
"description" text,
"status" text DEFAULT 'new' NOT NULL,
"severity" text DEFAULT 'playable' NOT NULL,
"priority" text DEFAULT 'low' NOT NULL,
"severity" text DEFAULT 'minor' NOT NULL,
"priority" text DEFAULT 'medium' NOT NULL,
"consistency" text DEFAULT 'intermittent' NOT NULL,
"reported_by" uuid,
"unconfirmed_reported_by" uuid,
"assigned_to" uuid,
"resolved_at" timestamp with time zone,
"closed_at" timestamp with time zone,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
CONSTRAINT "unique_issue_number" UNIQUE("machine_initials","issue_number")
CONSTRAINT "unique_issue_number" UNIQUE("machine_initials","issue_number"),
CONSTRAINT "reporter_check" CHECK ((reported_by IS NULL OR unconfirmed_reported_by IS NULL))
);
--> statement-breakpoint
CREATE TABLE "machines" (
Expand All @@ -38,10 +40,12 @@ CREATE TABLE "machines" (
"next_issue_number" integer DEFAULT 1 NOT NULL,
"name" text NOT NULL,
"owner_id" uuid,
"unconfirmed_owner_id" uuid,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
CONSTRAINT "machines_initials_unique" UNIQUE("initials"),
CONSTRAINT "initials_check" CHECK (initials ~ '^[A-Z0-9]{2,6}$')
CONSTRAINT "initials_check" CHECK (initials ~ '^[A-Z0-9]{2,6}$'),
CONSTRAINT "owner_check" CHECK ((owner_id IS NULL OR unconfirmed_owner_id IS NULL))
);
--> statement-breakpoint
CREATE TABLE "notification_preferences" (
Expand Down Expand Up @@ -70,15 +74,29 @@ CREATE TABLE "notifications" (
"created_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "unconfirmed_users" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"first_name" text NOT NULL,
"last_name" text NOT NULL,
"name" text GENERATED ALWAYS AS (first_name || ' ' || last_name) STORED NOT NULL,
"email" text NOT NULL,
"role" text DEFAULT 'guest' NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"invite_sent_at" timestamp with time zone,
CONSTRAINT "unconfirmed_users_email_unique" UNIQUE("email")
);
--> statement-breakpoint
CREATE TABLE "user_profiles" (
"id" uuid PRIMARY KEY NOT NULL,
"email" text NOT NULL,
"first_name" text NOT NULL,
"last_name" text NOT NULL,
"name" text GENERATED ALWAYS AS (first_name || ' ' || last_name) STORED NOT NULL,
"avatar_url" text,
"role" text DEFAULT 'member' NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
CONSTRAINT "user_profiles_email_unique" UNIQUE("email")
);
--> statement-breakpoint
ALTER TABLE "issue_comments" ADD CONSTRAINT "issue_comments_issue_id_issues_id_fk" FOREIGN KEY ("issue_id") REFERENCES "public"."issues"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
Expand All @@ -87,10 +105,21 @@ ALTER TABLE "issue_watchers" ADD CONSTRAINT "issue_watchers_issue_id_issues_id_f
ALTER TABLE "issue_watchers" ADD CONSTRAINT "issue_watchers_user_id_user_profiles_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user_profiles"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "issues" ADD CONSTRAINT "issues_machine_initials_machines_initials_fk" FOREIGN KEY ("machine_initials") REFERENCES "public"."machines"("initials") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "issues" ADD CONSTRAINT "issues_reported_by_user_profiles_id_fk" FOREIGN KEY ("reported_by") REFERENCES "public"."user_profiles"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "issues" ADD CONSTRAINT "issues_unconfirmed_reported_by_unconfirmed_users_id_fk" FOREIGN KEY ("unconfirmed_reported_by") REFERENCES "public"."unconfirmed_users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "issues" ADD CONSTRAINT "issues_assigned_to_user_profiles_id_fk" FOREIGN KEY ("assigned_to") REFERENCES "public"."user_profiles"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "machines" ADD CONSTRAINT "machines_owner_id_user_profiles_id_fk" FOREIGN KEY ("owner_id") REFERENCES "public"."user_profiles"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "machines" ADD CONSTRAINT "machines_unconfirmed_owner_id_unconfirmed_users_id_fk" FOREIGN KEY ("unconfirmed_owner_id") REFERENCES "public"."unconfirmed_users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "notification_preferences" ADD CONSTRAINT "notification_preferences_user_id_user_profiles_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user_profiles"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "notifications" ADD CONSTRAINT "notifications_user_id_user_profiles_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user_profiles"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "idx_issue_watchers_issue_id" ON "issue_watchers" USING btree ("issue_id");--> statement-breakpoint
CREATE INDEX "idx_issue_comments_issue_id" ON "issue_comments" USING btree ("issue_id");--> statement-breakpoint
CREATE INDEX "idx_issue_comments_author_id" ON "issue_comments" USING btree ("author_id");--> statement-breakpoint
CREATE INDEX "idx_issue_watchers_user_id" ON "issue_watchers" USING btree ("user_id");--> statement-breakpoint
CREATE INDEX "idx_issues_assigned_to" ON "issues" USING btree ("assigned_to");--> statement-breakpoint
CREATE INDEX "idx_issues_reported_by" ON "issues" USING btree ("reported_by");--> statement-breakpoint
CREATE INDEX "idx_issues_status" ON "issues" USING btree ("status");--> statement-breakpoint
CREATE INDEX "idx_issues_created_at" ON "issues" USING btree ("created_at");--> statement-breakpoint
CREATE INDEX "idx_issues_unconfirmed_reported_by" ON "issues" USING btree ("unconfirmed_reported_by");--> statement-breakpoint
CREATE INDEX "idx_machines_owner_id" ON "machines" USING btree ("owner_id");--> statement-breakpoint
CREATE INDEX "idx_machines_unconfirmed_owner_id" ON "machines" USING btree ("unconfirmed_owner_id");--> statement-breakpoint
CREATE INDEX "idx_notif_prefs_global_watch_email" ON "notification_preferences" USING btree ("email_watch_new_issues_global");--> statement-breakpoint
CREATE INDEX "idx_notifications_user_unread" ON "notifications" USING btree ("user_id","read_at","created_at");
3 changes: 0 additions & 3 deletions drizzle/0001_add_performance_indexes.sql

This file was deleted.

2 changes: 0 additions & 2 deletions drizzle/0002_add_more_performance_indexes.sql

This file was deleted.

51 changes: 0 additions & 51 deletions drizzle/0003_add_unconfirmed_users.sql

This file was deleted.

3 changes: 0 additions & 3 deletions drizzle/0004_whole_kate_bishop.sql

This file was deleted.

10 changes: 0 additions & 10 deletions drizzle/0005_add_email_to_profiles.sql

This file was deleted.

3 changes: 0 additions & 3 deletions drizzle/0006_add_performance_indexes.sql

This file was deleted.

Loading
Loading