Updated db

This commit is contained in:
2025-06-26 12:38:41 +02:00
parent 8c01d743cb
commit 9f1077e05e
4 changed files with 15 additions and 6 deletions

View File

@@ -36,7 +36,8 @@ CREATE TABLE "urls" (
"forward_query_params" boolean DEFAULT true, "forward_query_params" boolean DEFAULT true,
"crawable" boolean DEFAULT false, "crawable" boolean DEFAULT false,
"created_at" timestamp with time zone DEFAULT now(), "created_at" timestamp with time zone DEFAULT now(),
"updated_at" timestamp with time zone DEFAULT now() "updated_at" timestamp with time zone DEFAULT now(),
CONSTRAINT "urls_slug_unique" UNIQUE("slug")
); );
--> statement-breakpoint --> statement-breakpoint
CREATE TABLE "user" ( CREATE TABLE "user" (

View File

@@ -1,5 +1,5 @@
{ {
"id": "8abb5597-a405-4ece-9855-cd951cfac397", "id": "79b6d1a7-2d90-461c-bd57-51a42fc17b23",
"prevId": "00000000-0000-0000-0000-000000000000", "prevId": "00000000-0000-0000-0000-000000000000",
"version": "7", "version": "7",
"dialect": "postgresql", "dialect": "postgresql",
@@ -310,7 +310,15 @@
}, },
"foreignKeys": {}, "foreignKeys": {},
"compositePrimaryKeys": {}, "compositePrimaryKeys": {},
"uniqueConstraints": {}, "uniqueConstraints": {
"urls_slug_unique": {
"name": "urls_slug_unique",
"nullsNotDistinct": false,
"columns": [
"slug"
]
}
},
"policies": {}, "policies": {},
"checkConstraints": {}, "checkConstraints": {},
"isRLSEnabled": false "isRLSEnabled": false

View File

@@ -5,8 +5,8 @@
{ {
"idx": 0, "idx": 0,
"version": "7", "version": "7",
"when": 1750933043047, "when": 1750934261568,
"tag": "0000_classy_plazm", "tag": "0000_cultured_colonel_america",
"breakpoints": true "breakpoints": true
} }
] ]

View File

@@ -9,7 +9,7 @@ const updatedAt = timestamp("updated_at", { withTimezone: true }).defaultNow().$
export const urls = pgTable("urls", { export const urls = pgTable("urls", {
id: uuid("id").primaryKey().notNull(), id: uuid("id").primaryKey().notNull(),
url: varchar("url").notNull(), url: varchar("url").notNull(),
slug: varchar("slug").notNull(), slug: varchar("slug").unique().notNull(),
title: varchar("title").notNull(), title: varchar("title").notNull(),
maxVisits: integer("max_visits"), maxVisits: integer("max_visits"),
expDate: timestamp("exp_date", { withTimezone: true }), expDate: timestamp("exp_date", { withTimezone: true }),