Create a Laravel recipe as per below and then run it against the target server
apt-get update && apt-get install -y postgresql-17-pgvector
You can then make a migration
return new class extends Migration
{
public function up(): void
{
DB::statement('CREATE EXTENSION IF NOT EXISTS vector');
}
public function down(): void
{
DB::statement('DROP EXTENSION IF EXISTS vector');
}
};
Leave a Reply