Skip to content

Commit 979252d

Browse files
clean up data and transition
1 parent 160c36f commit 979252d

File tree

5 files changed

+31
-13
lines changed

5 files changed

+31
-13
lines changed

src/drizzle/0000_ambitious_maggott.sql renamed to src/drizzle/0000_slow_doctor_faustus.sql

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ CREATE TYPE "public"."color" AS ENUM('magenta', 'dawn', 'skin', 'emerald', 'sky'
22
CREATE TABLE "activity" (
33
"activityId" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "activity_activityId_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
44
"name" varchar NOT NULL,
5-
"category_id" integer NOT NULL
5+
"category_id" integer NOT NULL,
6+
CONSTRAINT "activity_name_unique" UNIQUE("name")
67
);
78
--> statement-breakpoint
89
CREATE TABLE "category" (
910
"categoryId" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "category_categoryId_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
1011
"name" varchar NOT NULL,
11-
"color" "color" NOT NULL
12+
"color" "color" NOT NULL,
13+
CONSTRAINT "category_name_unique" UNIQUE("name")
1214
);
1315
--> statement-breakpoint
1416
CREATE TABLE "log" (

src/drizzle/meta/0000_snapshot.json

+19-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"id": "7f91f4f4-51a6-450c-9aa5-a43d21bc59ee",
2+
"id": "253b89e5-b1eb-4789-9a58-96a5016fb85a",
33
"prevId": "00000000-0000-0000-0000-000000000000",
44
"version": "7",
55
"dialect": "postgresql",
@@ -55,7 +55,15 @@
5555
}
5656
},
5757
"compositePrimaryKeys": {},
58-
"uniqueConstraints": {},
58+
"uniqueConstraints": {
59+
"activity_name_unique": {
60+
"name": "activity_name_unique",
61+
"nullsNotDistinct": false,
62+
"columns": [
63+
"name"
64+
]
65+
}
66+
},
5967
"policies": {},
6068
"checkConstraints": {},
6169
"isRLSEnabled": false
@@ -98,7 +106,15 @@
98106
"indexes": {},
99107
"foreignKeys": {},
100108
"compositePrimaryKeys": {},
101-
"uniqueConstraints": {},
109+
"uniqueConstraints": {
110+
"category_name_unique": {
111+
"name": "category_name_unique",
112+
"nullsNotDistinct": false,
113+
"columns": [
114+
"name"
115+
]
116+
}
117+
},
102118
"policies": {},
103119
"checkConstraints": {},
104120
"isRLSEnabled": false

src/drizzle/meta/_journal.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
{
66
"idx": 0,
77
"version": "7",
8-
"when": 1736312263987,
9-
"tag": "0000_ambitious_maggott",
8+
"when": 1736349746144,
9+
"tag": "0000_slow_doctor_faustus",
1010
"breakpoints": true
1111
}
1212
]

src/lib/services/migrations.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import v0000 from "../../drizzle/0000_ambitious_maggott.sql?raw";
1+
import v0000 from "../../drizzle/0000_slow_doctor_faustus.sql?raw";
22

33
import type { PGlite } from "@electric-sql/pglite";
44
import { Data, Effect } from "effect";

src/routes/index.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ export const Route = createFileRoute("/")({
2727

2828
function HomeComponent() {
2929
const { date } = Route.useSearch();
30+
const isToday = date === DateTime.formatIsoDate(DateTime.unsafeNow());
3031
return (
3132
<div className="mx-auto max-w-[32rem] py-12 flex flex-col gap-y-12">
3233
<div className="flex flex-col gap-y-12 items-center">
3334
<div className="flex flex-col items-center gap-y-4">
3435
<Link
3536
to="."
36-
className="text-sm text-sky hover:cursor-pointer hover:underline inline-flex items-center gap-x-2 group"
37+
disabled={isToday}
38+
data-disabled={isToday}
39+
className="text-sm text-sky hover:cursor-pointer hover:underline inline-flex items-center gap-x-2 group data-[disabled=true]:opacity-10 hover:data-[disabled=false]:[&>[data-slot=icon]]:-rotate-180 [&>[data-slot=icon]]:transition-transform [&>[data-slot=icon]]:duration-300"
3740
>
3841
<span>Today</span>
39-
<RotateCcw
40-
size={12}
41-
className="group-hover:-rotate-270 transition-transform duration-300"
42-
/>
42+
<RotateCcw size={12} data-slot="icon" />
4343
</Link>
4444
<div className="flex items-center justify-between gap-x-8">
4545
<Link

0 commit comments

Comments
 (0)