how do I store list of string in my pg table
I want to store a list of user ids in my table with currently I am doing this
editors:text("editors").array().references(() => users.id, { onDelete: "cascade",}),
which is giving me this error error: foreign key constraint "youtube_channel_editors_user_id_fk" cannot be implemented
Detailed error => detail: 'Key columns "editors" and "id" are of incompatible types: text[] and text.', where: 'SQL statement "ALTER TABLE "youtube_channel" ADD CONSTRAINT "youtube_channel_editors_user_id_fk" FOREIGN KEY ("editors") REFERENCES "user"("id") ON DELETE cascade ON UPDATE no action"\n' + 'PL/pgSQL function inline_code_block line 2 at SQL statement'
3 Replies