fix: dockerfile
Some checks failed
Deploy to GitHub Pages / build_site (push) Failing after 36s

This commit is contained in:
max_richter 2024-12-20 12:36:11 +01:00
parent a0d420517c
commit c6badff1ee
6 changed files with 416 additions and 13 deletions

View File

@ -0,0 +1,14 @@
ALTER TABLE "nodes" ADD PRIMARY KEY ("id");--> statement-breakpoint
ALTER TABLE "users" ALTER COLUMN "id" SET DATA TYPE uuid;--> statement-breakpoint
ALTER TABLE "users" ALTER COLUMN "id" SET DEFAULT gen_random_uuid();--> statement-breakpoint
ALTER TABLE "users" ALTER COLUMN "name" SET NOT NULL;--> statement-breakpoint
ALTER TABLE "nodes" ADD COLUMN "userId" varchar NOT NULL;--> statement-breakpoint
ALTER TABLE "nodes" ADD COLUMN "systemId" varchar NOT NULL;--> statement-breakpoint
ALTER TABLE "nodes" ADD COLUMN "nodeId" varchar NOT NULL;--> statement-breakpoint
ALTER TABLE "nodes" ADD COLUMN "hash" varchar(8) NOT NULL;--> statement-breakpoint
ALTER TABLE "nodes" ADD COLUMN "previous" integer;--> 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 "node_id_idx" ON "nodes" USING btree ("nodeId");--> statement-breakpoint
CREATE INDEX "hash_idx" ON "nodes" USING btree ("hash");--> statement-breakpoint
ALTER TABLE "users" ADD CONSTRAINT "users_name_unique" UNIQUE("name");

View File

@ -0,0 +1,3 @@
ALTER TABLE "nodes" ALTER COLUMN "previous" SET DATA TYPE varchar(8);--> 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 "node_previous_fk" FOREIGN KEY ("previous") REFERENCES "public"."nodes"("hash") ON DELETE no action ON UPDATE no action;

View File

@ -0,0 +1,175 @@
{
"id": "3c2af8b1-1824-4003-a4f0-d3bfc27c235d",
"prevId": "53dea8d7-01be-4983-ac75-9de9c9a7f592",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.users": {
"name": "users",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"users_name_unique": {
"name": "users_name_unique",
"nullsNotDistinct": false,
"columns": [
"name"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.nodes": {
"name": "nodes",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"userId": {
"name": "userId",
"type": "varchar",
"primaryKey": false,
"notNull": true
},
"systemId": {
"name": "systemId",
"type": "varchar",
"primaryKey": false,
"notNull": true
},
"nodeId": {
"name": "nodeId",
"type": "varchar",
"primaryKey": false,
"notNull": true
},
"content": {
"name": "content",
"type": "bytea",
"primaryKey": false,
"notNull": true
},
"definition": {
"name": "definition",
"type": "json",
"primaryKey": false,
"notNull": true
},
"hash": {
"name": "hash",
"type": "varchar(8)",
"primaryKey": false,
"notNull": true
},
"previous": {
"name": "previous",
"type": "integer",
"primaryKey": false,
"notNull": false
}
},
"indexes": {
"user_id_idx": {
"name": "user_id_idx",
"columns": [
{
"expression": "userId",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"system_id_idx": {
"name": "system_id_idx",
"columns": [
{
"expression": "systemId",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"node_id_idx": {
"name": "node_id_idx",
"columns": [
{
"expression": "nodeId",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"hash_idx": {
"name": "hash_idx",
"columns": [
{
"expression": "hash",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {},
"schemas": {},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}

View File

@ -0,0 +1,202 @@
{
"id": "d950b459-4e3e-4a24-82d8-918eee2d8379",
"prevId": "3c2af8b1-1824-4003-a4f0-d3bfc27c235d",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.users": {
"name": "users",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"users_name_unique": {
"name": "users_name_unique",
"nullsNotDistinct": false,
"columns": [
"name"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.nodes": {
"name": "nodes",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"userId": {
"name": "userId",
"type": "varchar",
"primaryKey": false,
"notNull": true
},
"systemId": {
"name": "systemId",
"type": "varchar",
"primaryKey": false,
"notNull": true
},
"nodeId": {
"name": "nodeId",
"type": "varchar",
"primaryKey": false,
"notNull": true
},
"content": {
"name": "content",
"type": "bytea",
"primaryKey": false,
"notNull": true
},
"definition": {
"name": "definition",
"type": "json",
"primaryKey": false,
"notNull": true
},
"hash": {
"name": "hash",
"type": "varchar(8)",
"primaryKey": false,
"notNull": true
},
"previous": {
"name": "previous",
"type": "varchar(8)",
"primaryKey": false,
"notNull": false
}
},
"indexes": {
"user_id_idx": {
"name": "user_id_idx",
"columns": [
{
"expression": "userId",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"system_id_idx": {
"name": "system_id_idx",
"columns": [
{
"expression": "systemId",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"node_id_idx": {
"name": "node_id_idx",
"columns": [
{
"expression": "nodeId",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"hash_idx": {
"name": "hash_idx",
"columns": [
{
"expression": "hash",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"nodes_userId_users_id_fk": {
"name": "nodes_userId_users_id_fk",
"tableFrom": "nodes",
"tableTo": "users",
"columnsFrom": [
"userId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"node_previous_fk": {
"name": "node_previous_fk",
"tableFrom": "nodes",
"tableTo": "nodes",
"columnsFrom": [
"previous"
],
"columnsTo": [
"hash"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {},
"schemas": {},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}

View File

@ -8,6 +8,20 @@
"when": 1734446124519, "when": 1734446124519,
"tag": "0000_dark_squirrel_girl", "tag": "0000_dark_squirrel_girl",
"breakpoints": true "breakpoints": true
},
{
"idx": 1,
"version": "7",
"when": 1734693909872,
"tag": "0001_damp_captain_midlands",
"breakpoints": true
},
{
"idx": 2,
"version": "7",
"when": 1734694545302,
"tag": "0002_chemical_whiplash",
"breakpoints": true
} }
] ]
} }

View File

@ -1,5 +1,6 @@
import { import {
customType, customType,
foreignKey,
index, index,
integer, integer,
json, json,
@ -21,27 +22,21 @@ const bytea = customType<{
export const nodeTable = pgTable("nodes", { export const nodeTable = pgTable("nodes", {
id: serial().primaryKey(), id: serial().primaryKey(),
userId: varchar().notNull(), userId: varchar().notNull().references(() => usersTable.id),
systemId: varchar().notNull(), systemId: varchar().notNull(),
nodeId: varchar().notNull(), nodeId: varchar().notNull(),
content: bytea().notNull(), content: bytea().notNull(),
definition: json().notNull(), definition: json().notNull(),
hash: varchar({ length: 8 }).notNull(), hash: varchar({ length: 8 }).notNull(),
previous: integer(), previous: varchar({ length: 8 }),
}, (table) => [ }, (table) => [
foreignKey({
columns: [table.previous],
foreignColumns: [table.hash],
name: "node_previous_fk",
}),
index("user_id_idx").on(table.userId), index("user_id_idx").on(table.userId),
index("system_id_idx").on(table.systemId), index("system_id_idx").on(table.systemId),
index("node_id_idx").on(table.nodeId), index("node_id_idx").on(table.nodeId),
index("hash_idx").on(table.hash), index("hash_idx").on(table.hash),
]); ]);
export const nodeRelations = relations(nodeTable, ({ one }) => ({
userId: one(usersTable, {
fields: [nodeTable.userId],
references: [usersTable.id],
}),
previous: one(nodeTable, {
fields: [nodeTable.previous],
references: [nodeTable.id],
}),
}));