Skip to content

Commit a669247

Browse files
committed
add node nlp
1 parent 8ad77ea commit a669247

File tree

14 files changed

+1160
-3
lines changed

14 files changed

+1160
-3
lines changed

server/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"moment": "^2.30.1",
5656
"morgan": "^1.10.0",
5757
"multer": "1.4.5-lts.1",
58+
"node-nlp": "^4.27.0",
5859
"nodemailer": "^6.9.8",
5960
"pg": "^8.11.3",
6061
"react": "^18.2.0",
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
CREATE TABLE IF NOT EXISTS "intents" (
2+
"id" varchar(36) PRIMARY KEY NOT NULL,
3+
"name" text NOT NULL,
4+
"reference_id" text NOT NULL,
5+
"intents" json DEFAULT '[]'::json NOT NULL,
6+
"entities" json DEFAULT '[]'::json NOT NULL,
7+
"user_id" varchar(36) NOT NULL,
8+
"created_at" timestamp DEFAULT now(),
9+
"updated_at" timestamp DEFAULT now(),
10+
CONSTRAINT "intents_reference_id_unique" UNIQUE("reference_id")
11+
);
12+
--> statement-breakpoint
13+
ALTER TABLE "flows" ALTER COLUMN "variables" SET DEFAULT '[]'::json;--> statement-breakpoint
14+
ALTER TABLE "flows" DROP COLUMN IF EXISTS "diagrams";--> statement-breakpoint
15+
DO $$ BEGIN
16+
ALTER TABLE "intents" ADD CONSTRAINT "intents_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action;
17+
EXCEPTION
18+
WHEN duplicate_object THEN null;
19+
END $$;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
ALTER TABLE "intents" DROP CONSTRAINT "intents_reference_id_unique";--> statement-breakpoint
2+
ALTER TABLE "intents" DROP CONSTRAINT "intents_user_id_users_id_fk";
3+
--> statement-breakpoint
4+
ALTER TABLE "intents" ALTER COLUMN "intents" DROP NOT NULL;--> statement-breakpoint
5+
ALTER TABLE "intents" ADD COLUMN "deleted" boolean DEFAULT false;--> statement-breakpoint
6+
DO $$ BEGIN
7+
ALTER TABLE "intents" ADD CONSTRAINT "intents_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE cascade ON UPDATE no action;
8+
EXCEPTION
9+
WHEN duplicate_object THEN null;
10+
END $$;
11+
--> statement-breakpoint
12+
ALTER TABLE "intents" DROP COLUMN IF EXISTS "reference_id";

0 commit comments

Comments
 (0)