fix: error in schema
Some checks failed
Deploy to GitHub Pages / build_site (push) Failing after 36s
Some checks failed
Deploy to GitHub Pages / build_site (push) Failing after 36s
This commit is contained in:
parent
2814165ee6
commit
ec037a3bbd
@ -15,7 +15,7 @@ CREATE TABLE "nodes" (
|
|||||||
"previous" varchar(8)
|
"previous" varchar(8)
|
||||||
);
|
);
|
||||||
--> statement-breakpoint
|
--> statement-breakpoint
|
||||||
ALTER TABLE "nodes" ADD CONSTRAINT "nodes_userId_users_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
ALTER TABLE "nodes" ADD CONSTRAINT "nodes_userId_users_name_fk" FOREIGN KEY ("userId") REFERENCES "public"."users"("name") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
||||||
ALTER TABLE "nodes" ADD CONSTRAINT "node_previous_fk" FOREIGN KEY ("previous") REFERENCES "public"."nodes"("hash") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
ALTER TABLE "nodes" ADD CONSTRAINT "node_previous_fk" FOREIGN KEY ("previous") REFERENCES "public"."nodes"("hash") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
||||||
CREATE INDEX "user_id_idx" ON "nodes" USING btree ("userId");--> statement-breakpoint
|
CREATE INDEX "user_id_idx" ON "nodes" USING btree ("userId");--> statement-breakpoint
|
||||||
CREATE INDEX "system_id_idx" ON "nodes" USING btree ("systemId");--> statement-breakpoint
|
CREATE INDEX "system_id_idx" ON "nodes" USING btree ("systemId");--> statement-breakpoint
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"id": "91f8730d-dd5a-4a25-b840-e42b0ef1bc72",
|
"id": "e0d14457-de6a-4832-80fd-ee24523ff95c",
|
||||||
"prevId": "00000000-0000-0000-0000-000000000000",
|
"prevId": "00000000-0000-0000-0000-000000000000",
|
||||||
"version": "7",
|
"version": "7",
|
||||||
"dialect": "postgresql",
|
"dialect": "postgresql",
|
||||||
@ -154,15 +154,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"foreignKeys": {
|
"foreignKeys": {
|
||||||
"nodes_userId_users_id_fk": {
|
"nodes_userId_users_name_fk": {
|
||||||
"name": "nodes_userId_users_id_fk",
|
"name": "nodes_userId_users_name_fk",
|
||||||
"tableFrom": "nodes",
|
"tableFrom": "nodes",
|
||||||
"tableTo": "users",
|
"tableTo": "users",
|
||||||
"columnsFrom": [
|
"columnsFrom": [
|
||||||
"userId"
|
"userId"
|
||||||
],
|
],
|
||||||
"columnsTo": [
|
"columnsTo": [
|
||||||
"id"
|
"name"
|
||||||
],
|
],
|
||||||
"onDelete": "no action",
|
"onDelete": "no action",
|
||||||
"onUpdate": "no action"
|
"onUpdate": "no action"
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
{
|
{
|
||||||
"idx": 0,
|
"idx": 0,
|
||||||
"version": "7",
|
"version": "7",
|
||||||
"when": 1734694927055,
|
"when": 1734695191817,
|
||||||
"tag": "0000_clever_odin",
|
"tag": "0000_wakeful_zodiak",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -16,6 +16,7 @@ export const db = drizzle({
|
|||||||
schema,
|
schema,
|
||||||
});
|
});
|
||||||
|
|
||||||
export function migrateDb() {
|
export async function migrateDb() {
|
||||||
return migrate(db, { migrationsFolder: "drizzle" });
|
await migrate(db, { migrationsFolder: "drizzle" });
|
||||||
|
console.log("Database migrated");
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ const bytea = customType<{
|
|||||||
|
|
||||||
export const nodeTable = pgTable("nodes", {
|
export const nodeTable = pgTable("nodes", {
|
||||||
id: serial().primaryKey(),
|
id: serial().primaryKey(),
|
||||||
userId: varchar().notNull().references(() => usersTable.id),
|
userId: varchar().notNull().references(() => usersTable.name),
|
||||||
systemId: varchar().notNull(),
|
systemId: varchar().notNull(),
|
||||||
nodeId: varchar().notNull(),
|
nodeId: varchar().notNull(),
|
||||||
content: bytea().notNull(),
|
content: bytea().notNull(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user