-
Notifications
You must be signed in to change notification settings - Fork 3
Add AI pre-review for devlogs and projects #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: staging
Are you sure you want to change the base?
Changes from 1 commit
1b64ccd
8d1e549
72f0685
699b4de
e568b22
e8df8d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,32 @@ | ||||||
| CREATE TABLE "ai_devlog_review" ( | ||||||
| "id" serial PRIMARY KEY NOT NULL, | ||||||
| "devlogId" integer NOT NULL, | ||||||
| "projectId" integer NOT NULL, | ||||||
| "approved" boolean NOT NULL, | ||||||
| "rationale" text NOT NULL, | ||||||
| "prompt" text NOT NULL, | ||||||
| "model" text NOT NULL, | ||||||
| "createdAt" timestamp DEFAULT now() NOT NULL, | ||||||
| "updatedAt" timestamp DEFAULT now() NOT NULL, | ||||||
| CONSTRAINT "ai_devlog_review_devlogId_unique" UNIQUE ("devlogId") | ||||||
| ); | ||||||
| --> statement-breakpoint | ||||||
|
|
||||||
| ALTER TABLE "ai_devlog_review" ADD CONSTRAINT "ai_devlog_review_devlogId_devlog_id_fk" FOREIGN KEY ("devlogId") REFERENCES "devlog"("id") ON DELETE no action ON UPDATE no action; | ||||||
| --> statement-breakpoint | ||||||
| ALTER TABLE "ai_devlog_review" ADD CONSTRAINT "ai_devlog_review_projectId_project_id_fk" FOREIGN KEY ("projectId") REFERENCES "project"("id") ON DELETE no action ON UPDATE no action; | ||||||
| --> statement-breakpoint | ||||||
|
|
||||||
| CREATE TABLE "ai_project_review" ( | ||||||
| "id" serial PRIMARY KEY NOT NULL, | ||||||
| "projectId" integer NOT NULL, | ||||||
| "overallApproved" boolean NOT NULL, | ||||||
| "summary" text NOT NULL, | ||||||
| "prompt" text NOT NULL, | ||||||
| "model" text NOT NULL, | ||||||
| "createdAt" timestamp DEFAULT now() NOT NULL, | ||||||
| "updatedAt" timestamp DEFAULT now() NOT NULL, | ||||||
| CONSTRAINT "ai_project_review_projectId_unique" UNIQUE ("projectId") | ||||||
| ); | ||||||
| --> statement-breakpoint | ||||||
| ALTER TABLE "ai_project_review" ADD CONSTRAINT "ai_project_review_projectId_project_id_fk" FOREIGN KEY ("projectId") REFERENCES "project"("id") ON DELETE no action ON UPDATE no action; | ||||||
|
||||||
| ALTER TABLE "ai_project_review" ADD CONSTRAINT "ai_project_review_projectId_project_id_fk" FOREIGN KEY ("projectId") REFERENCES "project"("id") ON DELETE no action ON UPDATE no action; | |
| ALTER TABLE "ai_project_review" ADD CONSTRAINT "ai_project_review_projectId_project_id_fk" FOREIGN KEY ("projectId") REFERENCES "project"("id") ON DELETE CASCADE ON UPDATE no action; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,277 @@ | ||
| { | ||
| "id": "5c6f3ce1-9e64-4e8c-93ab-9fd1d3ae1b70", | ||
| "prevId": "dd1faf34-f215-4e5a-95a9-66c21e151248", | ||
| "version": "7", | ||
| "dialect": "postgresql", | ||
| "tables": { | ||
| "public.ai_devlog_review": { | ||
| "name": "ai_devlog_review", | ||
| "schema": "", | ||
| "columns": { | ||
| "id": { "name": "id", "type": "serial", "primaryKey": true, "notNull": true }, | ||
| "devlogId": { "name": "devlogId", "type": "integer", "primaryKey": false, "notNull": true }, | ||
| "projectId": { "name": "projectId", "type": "integer", "primaryKey": false, "notNull": true }, | ||
| "approved": { "name": "approved", "type": "boolean", "primaryKey": false, "notNull": true }, | ||
| "rationale": { "name": "rationale", "type": "text", "primaryKey": false, "notNull": true }, | ||
| "prompt": { "name": "prompt", "type": "text", "primaryKey": false, "notNull": true }, | ||
| "model": { "name": "model", "type": "text", "primaryKey": false, "notNull": true }, | ||
| "createdAt": { "name": "createdAt", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, | ||
| "updatedAt": { "name": "updatedAt", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" } | ||
| }, | ||
| "indexes": {}, | ||
| "foreignKeys": { | ||
| "ai_devlog_review_devlogId_devlog_id_fk": { | ||
| "name": "ai_devlog_review_devlogId_devlog_id_fk", | ||
| "tableFrom": "ai_devlog_review", | ||
| "tableTo": "devlog", | ||
| "columnsFrom": ["devlogId"], | ||
| "columnsTo": ["id"], | ||
| "onDelete": "no action", | ||
| "onUpdate": "no action" | ||
| }, | ||
| "ai_devlog_review_projectId_project_id_fk": { | ||
| "name": "ai_devlog_review_projectId_project_id_fk", | ||
| "tableFrom": "ai_devlog_review", | ||
| "tableTo": "project", | ||
| "columnsFrom": ["projectId"], | ||
| "columnsTo": ["id"], | ||
| "onDelete": "no action", | ||
| "onUpdate": "no action" | ||
| } | ||
| }, | ||
| "compositePrimaryKeys": {}, | ||
| "uniqueConstraints": { | ||
| "ai_devlog_review_devlogId_unique": { | ||
| "name": "ai_devlog_review_devlogId_unique", | ||
| "nullsNotDistinct": false, | ||
| "columns": ["devlogId"] | ||
| } | ||
| }, | ||
| "policies": {}, | ||
| "checkConstraints": {}, | ||
| "isRLSEnabled": false | ||
| }, | ||
| "public.ai_project_review": { | ||
| "name": "ai_project_review", | ||
| "schema": "", | ||
| "columns": { | ||
| "id": { "name": "id", "type": "serial", "primaryKey": true, "notNull": true }, | ||
| "projectId": { "name": "projectId", "type": "integer", "primaryKey": false, "notNull": true }, | ||
| "overallApproved": { "name": "overallApproved", "type": "boolean", "primaryKey": false, "notNull": true }, | ||
| "summary": { "name": "summary", "type": "text", "primaryKey": false, "notNull": true }, | ||
| "prompt": { "name": "prompt", "type": "text", "primaryKey": false, "notNull": true }, | ||
| "model": { "name": "model", "type": "text", "primaryKey": false, "notNull": true }, | ||
| "createdAt": { "name": "createdAt", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, | ||
| "updatedAt": { "name": "updatedAt", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" } | ||
| }, | ||
| "indexes": {}, | ||
| "foreignKeys": { | ||
| "ai_project_review_projectId_project_id_fk": { | ||
| "name": "ai_project_review_projectId_project_id_fk", | ||
| "tableFrom": "ai_project_review", | ||
| "tableTo": "project", | ||
| "columnsFrom": ["projectId"], | ||
| "columnsTo": ["id"], | ||
| "onDelete": "no action", | ||
| "onUpdate": "no action" | ||
| } | ||
| }, | ||
| "compositePrimaryKeys": {}, | ||
| "uniqueConstraints": { | ||
| "ai_project_review_projectId_unique": { | ||
| "name": "ai_project_review_projectId_unique", | ||
| "nullsNotDistinct": false, | ||
| "columns": ["projectId"] | ||
| } | ||
| }, | ||
| "policies": {}, | ||
| "checkConstraints": {}, | ||
| "isRLSEnabled": false | ||
| }, | ||
| "public.devlog": { | ||
| "name": "devlog", | ||
| "schema": "", | ||
| "columns": { | ||
| "id": { "name": "id", "type": "serial", "primaryKey": true, "notNull": true }, | ||
| "userId": { "name": "userId", "type": "integer", "primaryKey": false, "notNull": false }, | ||
| "projectId": { "name": "projectId", "type": "integer", "primaryKey": false, "notNull": true }, | ||
| "description": { "name": "description", "type": "text", "primaryKey": false, "notNull": true }, | ||
| "timeSpent": { "name": "timeSpent", "type": "integer", "primaryKey": false, "notNull": true }, | ||
| "image": { "name": "image", "type": "text", "primaryKey": false, "notNull": true }, | ||
| "model": { "name": "model", "type": "text", "primaryKey": false, "notNull": true }, | ||
| "deleted": { "name": "deleted", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, | ||
| "createdAt": { "name": "createdAt", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, | ||
| "updatedAt": { "name": "updatedAt", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" } | ||
| }, | ||
| "indexes": {}, | ||
| "foreignKeys": { | ||
| "devlog_userId_user_id_fk": { | ||
| "name": "devlog_userId_user_id_fk", | ||
| "tableFrom": "devlog", | ||
| "tableTo": "user", | ||
| "columnsFrom": ["userId"], | ||
| "columnsTo": ["id"], | ||
| "onDelete": "no action", | ||
| "onUpdate": "no action" | ||
| }, | ||
| "devlog_projectId_project_id_fk": { | ||
| "name": "devlog_projectId_project_id_fk", | ||
| "tableFrom": "devlog", | ||
| "tableTo": "project", | ||
| "columnsFrom": ["projectId"], | ||
| "columnsTo": ["id"], | ||
| "onDelete": "no action", | ||
| "onUpdate": "no action" | ||
| } | ||
| }, | ||
| "compositePrimaryKeys": {}, | ||
| "uniqueConstraints": {}, | ||
| "policies": {}, | ||
| "checkConstraints": {}, | ||
| "isRLSEnabled": false | ||
| }, | ||
| "public.project": { | ||
| "name": "project", | ||
| "schema": "", | ||
| "columns": { | ||
| "id": { "name": "id", "type": "serial", "primaryKey": true, "notNull": true }, | ||
| "userId": { "name": "userId", "type": "integer", "primaryKey": false, "notNull": true }, | ||
| "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": false }, | ||
| "description": { "name": "description", "type": "text", "primaryKey": false, "notNull": false }, | ||
| "url": { "name": "url", "type": "text", "primaryKey": false, "notNull": false }, | ||
| "status": { "name": "status", "type": "status", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'building'" }, | ||
| "deleted": { "name": "deleted", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, | ||
| "createdAt": { "name": "createdAt", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, | ||
| "updatedAt": { "name": "updatedAt", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" } | ||
| }, | ||
| "indexes": {}, | ||
| "foreignKeys": { | ||
| "project_userId_user_id_fk": { | ||
| "name": "project_userId_user_id_fk", | ||
| "tableFrom": "project", | ||
| "tableTo": "user", | ||
| "columnsFrom": ["userId"], | ||
| "columnsTo": ["id"], | ||
| "onDelete": "no action", | ||
| "onUpdate": "no action" | ||
| } | ||
| }, | ||
| "compositePrimaryKeys": {}, | ||
| "uniqueConstraints": {}, | ||
| "policies": {}, | ||
| "checkConstraints": {}, | ||
| "isRLSEnabled": false | ||
| }, | ||
| "public.session": { | ||
| "name": "session", | ||
| "schema": "", | ||
| "columns": { | ||
| "id": { "name": "id", "type": "serial", "primaryKey": true, "notNull": true }, | ||
| "token": { "name": "token", "type": "text", "primaryKey": false, "notNull": true }, | ||
| "userId": { "name": "userId", "type": "integer", "primaryKey": false, "notNull": true }, | ||
| "expiresAt": { "name": "expiresAt", "type": "timestamp", "primaryKey": false, "notNull": true } | ||
| }, | ||
| "indexes": {}, | ||
| "foreignKeys": { | ||
| "session_userId_user_id_fk": { | ||
| "name": "session_userId_user_id_fk", | ||
| "tableFrom": "session", | ||
| "tableTo": "user", | ||
| "columnsFrom": ["userId"], | ||
| "columnsTo": ["id"], | ||
| "onDelete": "no action", | ||
| "onUpdate": "no action" | ||
| } | ||
| }, | ||
| "compositePrimaryKeys": {}, | ||
| "uniqueConstraints": {}, | ||
| "policies": {}, | ||
| "checkConstraints": {}, | ||
| "isRLSEnabled": false | ||
| }, | ||
| "public.t1_review": { | ||
| "name": "t1_review", | ||
| "schema": "", | ||
| "columns": { | ||
| "id": { "name": "id", "type": "serial", "primaryKey": true, "notNull": true }, | ||
| "userId": { "name": "userId", "type": "integer", "primaryKey": false, "notNull": true }, | ||
| "projectId": { "name": "projectId", "type": "integer", "primaryKey": false, "notNull": true }, | ||
| "feedback": { "name": "feedback", "type": "text", "primaryKey": false, "notNull": false }, | ||
| "notes": { "name": "notes", "type": "text", "primaryKey": false, "notNull": false }, | ||
| "action": { "name": "action", "type": "t1_review_action", "typeSchema": "public", "primaryKey": false, "notNull": true }, | ||
| "timestamp": { "name": "timestamp", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" } | ||
| }, | ||
| "indexes": {}, | ||
| "foreignKeys": { | ||
| "t1_review_userId_user_id_fk": { | ||
| "name": "t1_review_userId_user_id_fk", | ||
| "tableFrom": "t1_review", | ||
| "tableTo": "user", | ||
| "columnsFrom": ["userId"], | ||
| "columnsTo": ["id"], | ||
| "onDelete": "no action", | ||
| "onUpdate": "no action" | ||
| }, | ||
| "t1_review_projectId_project_id_fk": { | ||
| "name": "t1_review_projectId_project_id_fk", | ||
| "tableFrom": "t1_review", | ||
| "tableTo": "project", | ||
| "columnsFrom": ["projectId"], | ||
| "columnsTo": ["id"], | ||
| "onDelete": "no action", | ||
| "onUpdate": "no action" | ||
| } | ||
| }, | ||
| "compositePrimaryKeys": {}, | ||
| "uniqueConstraints": {}, | ||
| "policies": {}, | ||
| "checkConstraints": {}, | ||
| "isRLSEnabled": false | ||
| }, | ||
| "public.user": { | ||
| "name": "user", | ||
| "schema": "", | ||
| "columns": { | ||
| "id": { "name": "id", "type": "serial", "primaryKey": true, "notNull": true }, | ||
| "idvId": { "name": "idvId", "type": "text", "primaryKey": false, "notNull": true }, | ||
| "slackId": { "name": "slackId", "type": "text", "primaryKey": false, "notNull": true }, | ||
| "profilePicture": { "name": "profilePicture", "type": "text", "primaryKey": false, "notNull": true }, | ||
| "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true }, | ||
| "hackatimeTrust": { "name": "hackatimeTrust", "type": "hackatime_trust", "typeSchema": "public", "primaryKey": false, "notNull": true }, | ||
| "trust": { "name": "trust", "type": "trust", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'blue'" }, | ||
| "clay": { "name": "clay", "type": "real", "primaryKey": false, "notNull": true, "default": 0 }, | ||
| "brick": { "name": "brick", "type": "real", "primaryKey": false, "notNull": true, "default": 0 }, | ||
| "shopScore": { "name": "shopScore", "type": "real", "primaryKey": false, "notNull": true, "default": 0 }, | ||
| "hasBasePrinter": { "name": "hasBasePrinter", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, | ||
| "hasT1Review": { "name": "hasT1Review", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, | ||
| "hasT2Review": { "name": "hasT2Review", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, | ||
| "hasAdmin": { "name": "hasAdmin", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, | ||
| "createdAt": { "name": "createdAt", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, | ||
| "lastLoginAt": { "name": "lastLoginAt", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" } | ||
| }, | ||
| "indexes": {}, | ||
| "foreignKeys": {}, | ||
| "compositePrimaryKeys": {}, | ||
| "uniqueConstraints": { | ||
| "user_idvId_unique": { "name": "user_idvId_unique", "nullsNotDistinct": false, "columns": ["idvId"] }, | ||
| "user_slackId_unique": { "name": "user_slackId_unique", "nullsNotDistinct": false, "columns": ["slackId"] } | ||
| }, | ||
| "policies": {}, | ||
| "checkConstraints": {}, | ||
| "isRLSEnabled": false | ||
| } | ||
| }, | ||
| "enums": { | ||
| "public.hackatime_trust": { "name": "hackatime_trust", "schema": "public", "values": ["green", "blue", "yellow", "red"] }, | ||
| "public.project_audit_log_type": { "name": "project_audit_log_type", "schema": "public", "values": ["create", "update", "delete"] }, | ||
| "public.status": { "name": "status", "schema": "public", "values": ["building", "submitted", "t1_approved", "printing", "printed", "t2_approved", "finalized", "rejected", "rejected_locked"] }, | ||
| "public.t1_review_action": { "name": "t1_review_action", "schema": "public", "values": ["approve", "approve_no_print", "add_comment", "reject", "reject_lock"] }, | ||
| "public.trust": { "name": "trust", "schema": "public", "values": ["green", "blue", "yellow", "red"] } | ||
| }, | ||
| "schemas": {}, | ||
| "sequences": {}, | ||
| "roles": {}, | ||
| "policies": {}, | ||
| "views": {}, | ||
| "_meta": { "columns": {}, "schemas": {}, "tables": {} } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.