Skip to content

Commit

Permalink
clean up data and transition
Browse files Browse the repository at this point in the history
  • Loading branch information
SandroMaglione committed Jan 8, 2025
1 parent 160c36f commit 979252d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ CREATE TYPE "public"."color" AS ENUM('magenta', 'dawn', 'skin', 'emerald', 'sky'
CREATE TABLE "activity" (
"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),
"name" varchar NOT NULL,
"category_id" integer NOT NULL
"category_id" integer NOT NULL,
CONSTRAINT "activity_name_unique" UNIQUE("name")
);
--> statement-breakpoint
CREATE TABLE "category" (
"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),
"name" varchar NOT NULL,
"color" "color" NOT NULL
"color" "color" NOT NULL,
CONSTRAINT "category_name_unique" UNIQUE("name")
);
--> statement-breakpoint
CREATE TABLE "log" (
Expand Down
22 changes: 19 additions & 3 deletions src/drizzle/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "7f91f4f4-51a6-450c-9aa5-a43d21bc59ee",
"id": "253b89e5-b1eb-4789-9a58-96a5016fb85a",
"prevId": "00000000-0000-0000-0000-000000000000",
"version": "7",
"dialect": "postgresql",
Expand Down Expand Up @@ -55,7 +55,15 @@
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"uniqueConstraints": {
"activity_name_unique": {
"name": "activity_name_unique",
"nullsNotDistinct": false,
"columns": [
"name"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
Expand Down Expand Up @@ -98,7 +106,15 @@
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"uniqueConstraints": {
"category_name_unique": {
"name": "category_name_unique",
"nullsNotDistinct": false,
"columns": [
"name"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
Expand Down
4 changes: 2 additions & 2 deletions src/drizzle/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
{
"idx": 0,
"version": "7",
"when": 1736312263987,
"tag": "0000_ambitious_maggott",
"when": 1736349746144,
"tag": "0000_slow_doctor_faustus",
"breakpoints": true
}
]
Expand Down
2 changes: 1 addition & 1 deletion src/lib/services/migrations.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import v0000 from "../../drizzle/0000_ambitious_maggott.sql?raw";
import v0000 from "../../drizzle/0000_slow_doctor_faustus.sql?raw";

import type { PGlite } from "@electric-sql/pglite";
import { Data, Effect } from "effect";
Expand Down
10 changes: 5 additions & 5 deletions src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ export const Route = createFileRoute("/")({

function HomeComponent() {
const { date } = Route.useSearch();
const isToday = date === DateTime.formatIsoDate(DateTime.unsafeNow());
return (
<div className="mx-auto max-w-[32rem] py-12 flex flex-col gap-y-12">
<div className="flex flex-col gap-y-12 items-center">
<div className="flex flex-col items-center gap-y-4">
<Link
to="."
className="text-sm text-sky hover:cursor-pointer hover:underline inline-flex items-center gap-x-2 group"
disabled={isToday}
data-disabled={isToday}
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"
>
<span>Today</span>
<RotateCcw
size={12}
className="group-hover:-rotate-270 transition-transform duration-300"
/>
<RotateCcw size={12} data-slot="icon" />
</Link>
<div className="flex items-center justify-between gap-x-8">
<Link
Expand Down

0 comments on commit 979252d

Please sign in to comment.